xaviershay / rspec-fire

Obsolete - use verifying doubles in RSpec 3
MIT License
361 stars 16 forks source link

Methods stubbed in hash are not verified #44

Closed bethesque closed 10 years ago

bethesque commented 10 years ago

eg.


class Bethtest
end

let(:bethtest) { instance_double("Bethtest", :doesnotexist => nil) }

does not raise any error.

See failing spec here

https://github.com/bethesque/rspec-fire-test

xaviershay commented 10 years ago

Thanks for the report! There was a spec for the positive behaviour of this, but not the negative: https://github.com/xaviershay/rspec-fire/blob/master/spec/fire_double_spec.rb#L178

I verified that your test case works as expected in the latest version rspec-mocks-3.0.0.beta1 (which completely replaces this gem).

Some unrelated notes about your repro:

bethesque commented 10 years ago

Ah yeah, stubbing "new" was left over from my original example, which had an extra class that used Bethtest as a collaborator that I realised later I didn't need.

Never noticed problems with the bundler thing before, it's in all our our Gemfiles. Is it because you have 1.4 installed? Maybe it's because we haven't upgraded yet that it hasn't hit us.

Thanks for the quick turn around!

xaviershay commented 10 years ago

yeah I'm on 1.4