[rspec-users] Mixing mocking frameworks?

Andrew Selder aselder at mac.com
Sun Jun 1 00:20:09 EDT 2008


First, it was great meeting a bunch of you at RailsConf.

Recently I've run into a problem using RSpec, namely its support for  
multiple mocking frameworks. Wait you say, isn't that a good thing?  
Yes, it is until you end up mixing frameworks.

I was writing my latest app, and I choose to get the app working and  
then add in the authentication system. So I went and wrote all my test  
using Mocha, and everything was all peachy. Then I went to github and  
got the latest version of restful_authentication. To the console,  
"script/generated authenticated user sessions --rspec", and run the  
test suite.

BOOM!!!!

It turns out that Rick Olson wrote all the specs for RESTful  
Authentication using RSpec's built-in mocking, and that didn't play  
nicely with Mocha being declared in the spec.opts file.

I think it would be nice to be able to set a mock framework per  
example group or spec file.

I'll grab a fork and start looking at it, but if you have any  
suggestions, they'd be greatly appreciated.

Andrew

--
Andrew Selder
Lead Developer
Boston Logic Technology Partners
aselder at bostonlogic.com
www.bostonlogic.com
www.logicmaps.com
www.logicrentals.com





More information about the rspec-users mailing list