Skip to content

Commit

Permalink
Merge d0da320 into 4932f3c
Browse files Browse the repository at this point in the history
  • Loading branch information
JonRowe committed Oct 22, 2013
2 parents 4932f3c + d0da320 commit e0b4555
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/rspec/mocks/method_reference.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,17 @@ def method_implemented?(m)
# definition of "implemented". However, it's the best we can do.
alias method_defined? method_implemented?

def find_method(m)
m.instance_method(@method_name)
# works around the fact that repeated calls for method parameters will
# falsely return empty arrays on JRuby in certain circumstances, this
# is necessary here because we can't dup/clone UnboundMethods
if RUBY_PLATFORM == 'java'
def find_method(m)
m.dup.instance_method(@method_name)
end
else
def find_method(m)
m.instance_method(@method_name)
end
end
end

Expand Down

0 comments on commit e0b4555

Please sign in to comment.