better_receive
better_receive copied to clipboard
Rspec 3.1 compatibility
Rspec 2 uses APIs that are deprecated in Rails 4.2. This is fixed in Rspec 3.1 but better_receive is tied to 2.1
:+1:
transpec might be helpful for this http://yujinakayama.me/transpec/
Thanks for the bump, kinda slipped past me. I'll get on this soon.
This functionality was supposed to be included in RSpec 3, I'm not sure how to turn it on though. You can definitely get full mocks, rspec-fire style, with the instance_double method... not sure about partial mocks.
If something like this is in RSpec 3, upgrading with transpec is definitely the smoothest option. Probably just requires a find-and-replace like s/better_receive/should_receive/ first.
Holy crap. Didn't know about transpec. That's great!
Thanks, @nertzy ! Huge help. Never heard about transpec before, and it is amazing.
I patched transpec to support converting better receive. The dynamic analysis isn't working yet, but the conversions seemed to work great. I hope to wrap it up and submit a pull request.
https://github.com/toothrot/transpec/tree/better-receive-support
Just an FYI for others, was looking into using Rspec 3 with this, but in my case using verifying doubles was enough.