How to use more than ONE mock frmk (mocha, rr, rspec)

View: New views
1 Messages — Rating Filter:   Alert me  

How to use more than ONE mock frmk (mocha, rr, rspec)

by 21croissants :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have started to play with http://pivots.pivotallabs.com/users/brian/blog/articles/352-introducing-rr and I really like its hyper-minimalist but readable syntax ...

For the sake of flexibility, I'd like to use more than 1 mock framework. E.g.: The specs which come with the restful-authentication plugin are using 'RSpec' mock framework and my project is ussing 'rr'

I thought I could put at the beginning of each file:

Spec::Runner.configure do |config|
  config.mock_with :rr
end

or

Spec::Runner.configure do |config|
  config.mock_with :rspec
end

Running each spec individually works but running them ALL within Autotest or "rake spec" will fail ...

I am using Rails 2.1 + RSpec edge.

I thought maybe someone has the same needs and found a solution. Otherwise, I'll patch Rspec