views:

345

answers:

2

I have a small test project that I'm using to test the waters for a much larger project. I am using rspec on rails for testing, but recently looked into Cucumber. It looks very nice, but I'm wondering if there's a way for cucumber to run my spec tests, or for rspec (autospec) to run my cucumber features. I've looked around extensively, but have yet to find a solid conclusion.

Thanks,

Mike

+2  A: 

An easy way to do this would be to create a Rake task that invokes both tools, such as this minimal example:

desc 'Run rspec + cucumber'
task :build => [:spec, :features]

Then you can build both with:

rake build

Both RSpec and Cucumber come with some default tasks which work with Rails, but you can customize the tasks to suit your needs. There's more info on writing rake tasks here.

ry
+3  A: 

I've been experimenting with Cucumber as well. It supports autotest:

AUTOFEATURE=true autospec

That runs both the rspec & cucumber test suite continuously.

jmay