Permalink
Browse files

Don't hit `__mock_proxy` unless you need to. This avoids a Rubby 1.8.…

…7 Proc equality bug: https://gist.github.com/1702877

This commit fixes the build for 1.8.7
  • Loading branch information...
1 parent de283b3 commit 9a201dafb3b0acfee4ff71f9feefc2a7ec2990fa @justinko justinko committed Jan 30, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/rspec/mocks/methods.rb
@@ -97,12 +97,13 @@ def stub_chain(*chain, &blk)
# are declared, they'll work as expected. If not, the receiver is
# returned.
def as_null_object
+ @_null_object = true
__mock_proxy.as_null_object
end
# Returns true if this object has received `as_null_object`
def null_object?
- __mock_proxy.null_object?
+ @_null_object
end
# @private

0 comments on commit 9a201da

Please sign in to comment.