Categories
How-To ruby WebApps

Setting Up Cucumber and RSpec on Padrino

This is a quick guide on how to set up Cucumber and RSpec on Padrino.

I’ve created a simple test app on github that reflects the steps written down here.

1. Create the app:

padrino g project todo -t cucumber -d sequel -b

2. In the Gemfile use rake 0.8.7:

gem 'rake', "0.8.7"

3. In features/support/env.rb comment out “require ‘spec/expectations'” so it looks like:

# require 'spec/expectations'

At this point ‘cucumber features’ should work and should return a failed test for adding two numbers.

Also at this point, if you create any models, then bare specs for them will be created in the ‘spec/models’ folder.

Please feel free to leave questions or comments if you’ve got a different way of setting things up on Padrino.

2 replies on “Setting Up Cucumber and RSpec on Padrino”

Thanks. very helpful!

on 1.8.7p72 I get:
json-1.5.3/ext/json/ext/json/ext/parser.so: [BUG] Segmentation fault
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]

but it works like a charm on 1.9.2p180
(without changing any line of code)

What ruby did you use? maybe p72 is the problem.

Hi Oren, Thanks for reading!

I got 1.8.7-p72 working.

rvm remove 1.8.7-p72
rvm install 1.8.7-p72

gem install bundler
gem install padrino
cd your_padrino_project
bundle install

The following should work without issue:
bundle exec cucumber features
bundle exec padrino start
bundle exec padrino rspec

Cheers, Barce

Leave a Reply

Your email address will not be published. Required fields are marked *