Cucumber

Cucumber is one of my favourite testing tools in Ruby on Rails. Here are some quick comments on some simple setup steps

Setting up profiles in Cucumber and accessing them using Rake

Create the appropriate profiles found in the /lib/cucumber.rake file in your project. Each section should look like the following:

Cucumber::Rake::Task.new({:rerun => 'test:prepare'}, 'Record failing features and run only them if any exist') do |t|
   t.binary = vendored_cucumber_bin
   t.fork = true # You may get faster startup if you set this to false
   t.profile = 'rerun'
end

Set up the profile with the appropriate configurations in the /config/cucumber.yml file. Here’s a sample line of how to configure your cucumber file

wip: --tags @wip:3 --wip features
Above is an example of the wip configuration that comes pre-configured when you install cucumber

Suppressing SQL log messages

Out of the box, the messages coming from Cucumber and RSpec is extremely verbose. I personally prefer to have them suppressed in test mode. To do that, you can add the following line inside the /config/environments/test.rb file
config.log_level = :error