Cucumber Tip: IRB From Inside a Step Definition
Most Ruby programmers know about Ruby's interactive console, IRB. (If you don't, stop right here, open up a command window and run irb. Type some Ruby code. See how it returns the result of each line right away.) IRB is great for poking around with unfamiliar libraries. Suppose you're using Capybara with Cucumber for the first time. It would be nice to use IRB to experiment with what Capybara can do on a particular page. You could launch an IRB session and duplicate all the Capybara setup from your Cucumber support/env.rb file. But wouldn't it be nice if you could just fire up IRB in the context of a step definition so you know everything in your IRB session matches what you'd get in the step def? Turns out you can. Here's how... Read More