January 2012
Intermediate to advanced
336 pages
8h 12m
English
We’ve decided this first release of our calculator is going to take its input from the user as a command-line argument, so our job in the step definition for Given the input "2+2" is just to remember the input so that we know what to pass on the command line when we run the calculator in the next step. In the features/step_definitions folder, edit the calculator_steps.rb file so that the first step definition looks like this:
| first_taste/03/features/step_definitions/calculator_steps.rb | |
| | Given /^the input "([^"]*)"$/ do |input| |
| | @input = input |
| | end |
All we’ve done here is store the input from the feature in a Ruby instance variable. That instance variable will be around for as long as this particular ...
Read now
Unlock full access