Working through chapter 8 I had some trouble using an after hook. If I give it a puts statement I see no output on the terminal window. Before works fine, I can see my “Starting scenario” string in the output, but not my “finished scenario” string.
To isolate any potential typos, I started again with a direct copy of the source provided in code/support_code/18 and made 2 small changes.
1) alter the feature so it fails 2) change the line in debugging.rb from: save_and_open_page if scenario.failed? to: puts “finished scenario”
Although the after statement is being run (I know this because save_and_open_page ran before I made the change) I never see the string being output. Any idea why? My setup is fairly standard. I’m on a Mac running ruby 1.9.3-p194 and have tried running cucumber via bundle exec so I should be getting all the right gem versions.