[rspec-users] How to use different mocking frameworks?

David Chelimsky dchelimsky at gmail.com
Sun Mar 15 01:01:19 EDT 2009

On Sat, Mar 14, 2009 at 8:37 PM, Val <vagostino at gmail.com> wrote:
> Hi,
> I'm pretty new to Rspec, so hope someone can help me out with this.
> I'm leveraging a couple pre-existing applications in my current
> project, both have fairly robust test suites in Rspec already.
> However, one is using Rspec's builit in mocking, and the other is
> using mocha.
> If I set config.mock_with mocha in spec_helper.rb, then all of the
> rspec mocks fail.  If I comment this out, all of the specs with mocha
> fail.
> Is there some way to set the mocking framework on a test and/or file
> basis?

Nope. Gotta pick one or the other. Reason - diff mock frameworks
invade Object in diff ways - mixing and matching is dangerous to your

> I've been all over Google, and can't seem to find a resolution
> to this.  I really don't want to have to back through and rewrite
> someone else's test suite that is already working.
> Thanks in advance for your help,
> Val
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list