Permalink
Browse files

Using `instance_method(name)` instead of `instance_methods.include?(n…

…ame)`.
  • Loading branch information...
1 parent ab6a966 commit ff0e02bc6a7ed60b2328bb06f1151ea0cc422f42 @cfcosta committed Oct 10, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/minitest/fire_mock.rb
@@ -9,7 +9,8 @@ def initialize(constant)
end
def expect(name, retval, args = [])
- if @constant and not @constant.instance_methods.include? name
+ method = @constant.instance_method(name) rescue nil
+ if @constant and not method
raise MockExpectationError, "expected #{@constant_name} to define `#{name}`, but it doesn't"
end

0 comments on commit ff0e02b

Please sign in to comment.