Skip to content

Commit

Permalink
- Add include_private param to MiniTest::Mock#respond_to? (rf-)
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//src/minitest/dev/": change = 7794]
  • Loading branch information
zenspider committed Sep 26, 2012
1 parent e8b70f5 commit 88a5037
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/minitest/mock.rb
Expand Up @@ -120,9 +120,9 @@ def method_missing(sym, *args) # :nodoc:
retval
end

def respond_to?(sym) # :nodoc:
def respond_to?(sym, include_private = false) # :nodoc:
return true if @expected_calls.has_key?(sym.to_sym)
return __respond_to?(sym)
return __respond_to?(sym, include_private)
end
end
end
Expand Down
1 change: 1 addition & 0 deletions test/minitest/test_minitest_mock.rb
Expand Up @@ -96,6 +96,7 @@ def test_expect_with_non_array_args

def test_respond_appropriately
assert @mock.respond_to?(:foo)
assert @mock.respond_to?(:foo, true)
assert @mock.respond_to?('foo')
assert !@mock.respond_to?(:bar)
end
Expand Down

0 comments on commit 88a5037

Please sign in to comment.