January 2012
Intermediate to advanced
336 pages
8h 12m
English
Without thinking too much about what they mean, let’s just copy and paste the snippets from Cucumber’s last output into a Ruby file. Just like the features, Cucumber is expecting the step definitions to be found in a conventional place:
| | $ mkdir features/step_definitions |
Now create a Ruby file in features/step_definitions, called calculator_steps.rb. Cucumber won’t mind what you call it as long as it’s a Ruby file, but this is a good name to use. Open it in your text editor and paste in those snippets:
| first_taste/02/features/step_definitions/calculator_steps.rb | |
| | Given /^the input "([^"]*)"$/ do |arg1| |
| | pending # express the regexp above with the code you wish you had |
| | end |
| | |
| | When /^the calculator is run$/ ... |
Read now
Unlock full access