better_receive icon indicating copy to clipboard operation
better_receive copied to clipboard

Rspec 3.1 compatibility

Open samanthamjohn opened this issue 10 years ago • 6 comments

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

samanthamjohn avatar Dec 24 '14 05:12 samanthamjohn

:+1:

toothrot avatar May 05 '15 14:05 toothrot

transpec might be helpful for this http://yujinakayama.me/transpec/

nertzy avatar May 05 '15 15:05 nertzy

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.

se3000 avatar May 05 '15 16:05 se3000

Holy crap. Didn't know about transpec. That's great!

toothrot avatar May 05 '15 18:05 toothrot

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

toothrot avatar May 21 '15 15:05 toothrot

Just an FYI for others, was looking into using Rspec 3 with this, but in my case using verifying doubles was enough.

abepetrillo avatar Nov 03 '15 14:11 abepetrillo