For a test suite that's already using mocha for mocking, can new tests be written with rspec mocking? maybe turn that on before(:all) and turn it back to mocha after(:all)
I tried changing the Spec::Runner configuration at run-time and that didn't seem to work with mocking
I have published a new gem for this. You can find more details here -> http://github.com/endeepak/rspec-multi-mock
It sounds like Deepak's RSpec Multi Mock gem solves this.
But you should ask yourself if this is really what you want. Ultimately, consistency is most important, and using a mix of mocking frameworks within the same app is bound to lead to confusion.
Personally I'm quite happy with RSpec's built-in mocking and don't usually find the need for Mocha on my own projects. But some of my peers prefer Mocha and I'm not really aware of any limitations of Mocha compared to vanilla RSpec mocking, so I'd recommend sticking with Mocha if that's what the app already uses. Even though I know its "any_instance" support is considered a code smell by some, it does occasionally come in very handy. :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With