0
我有在行动书导轨3,在第二章黄瓜在Rails 3中
Feature: My Account
In order to manage my account
As a money minder
I want to ensure my money doesn't get lost
Scenario: Taking out money
Given I have an account
And it has a balance of 100
When I take 10
Then my balance should be 90
在终端我有这样的:
➜ accounts cucumber features
Feature: My Account
In order to manage my account
As a money minder
I want to ensure my money doesn't get lost
Scenario: Taking out money # features/account.feature:6
Given I have an account # features/account.feature:7
And it has a balance of 100 # features/account.feature:8
When I take 10 # features/account.feature:9
Then my balance should be 90 # features/account.feature:10
1 scenario (1 undefined)
4 steps (4 undefined)
0m0.002s
You can implement step definitions for undefined steps with these snippets:
Given(/^I have an account$/) do
pending # express the regexp above with the code you wish you had
end
Given(/^it has a balance of (\d+)$/) do |arg1|
pending # express the regexp above with the code you wish you had
end
When(/^I take (\d+)$/) do |arg1|
pending # express the regexp above with the code you wish you had
end
Then(/^my balance should be (\d+)$/) do |arg1|
pending # express the regexp above with the code you wish you had
end
If you want snippets in a different programming language,
just make sure a file with the appropriate file extension
exists where cucumber looks for step definitions.
我对
Rails -v 3.2.12
Ruby -v 1.9.3
cucumber (1.3.2)
cucumber-rails (1.2.1)
那我该怎么做?这本书在接下来的章节中也会使用cucmber。
它的第一次我用黄瓜,所以我需要一个解释,我已搜查谷歌和发现了一篇文章,但我并没有得到它的时候,我希望我能找到一个更简单的解释