Adding an Assertion

So, following Cucumber’s lead, we need to create a Ruby file for our program. Let’s just create an empty Ruby file for the time being so that we can stay on the outside and get the test finished before we go on to the solution. Linux/Mac users can type this to create an empty file:

 
$ ​touch calc.rb

If you’re using Windows, there is no touch command, so either just create an empty text file named calc.rb in your editor or use this little trick:

 
C:\>​ echo.>calc.rb

When we run cucumber again, we should see that the second step is passing and we’re on to the final step:

 
$ ​cucumber --format progress
 
..P
 
 
(::) pending steps (::)
 
 
features/adding.feature:6:in ‘Then the output should be "4"’
 
 
1 scenario (1 pending) ...

Get The Cucumber Book now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.