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:
|||Given(/^the input "([^"]*)"$/) do |input||
|||@input = input|
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 ...