views:

28

answers:

1

Hello, I have a pre-written Rails app for handling subscription based payments that is currently covered with an Rspec test suite. I'm trying to merge it into a Rails app that is covered using the Shoulda test suite.

I'd really hate to have to rewrite all the tests into Shoulda compatible matchers manually, so I was wondering if there may be an easier way to do this. I'm not very experienced with either testing framework, so I'm trying to make a plan on the best way to start.

I've heard that Shoulda has some Rspec compatible matchers, but do they cover every rspec matcher? Could it really be as easy as that?

Has anyone had any experience doing something like this, and how much of a problem was it?

A: 

I think you might have better luck going to RSpec. To the best of my knowledge, rSpec will run both Test::Unit (and therefore shoulda macros) along with Spec files. If you were to move everything to shoulda, then I think you would end up rewriting many of the tests.

http://blog.davidchelimsky.net/2009/02/02/rspec-works-with-test-unit/

So it should just be a matter of moving your tests over to specs.

I have never tried to run shoulda macros within rspec, only the shoulda matchers. I don't believe it would be that much of an issue though.

Geoff Lanotte
Ah, really? I was really hoping to get a chance to learn shoulda this time around :( I might just have to do it this way though. Thanks for the advice!
japancheese