test/unit/mock_test.rb in mocha-0.13.2 vs test/unit/mock_test.rb in mocha-0.13.3
- old
+ new
@@ -43,12 +43,12 @@
mock = build_mock
assert_equal true, mock.eql?(mock)
end
if RUBY_VERSION < '1.9'
- OBJECT_METHODS = STANDARD_OBJECT_PUBLIC_INSTANCE_METHODS.reject { |m| m =~ /^__.*__$/ }
+ OBJECT_METHODS = STANDARD_OBJECT_PUBLIC_INSTANCE_METHODS.reject { |m| m =~ /^__.*__$/ || ["method_missing", "singleton_method_undefined", "initialize"].include?(m)}
else
- OBJECT_METHODS = STANDARD_OBJECT_PUBLIC_INSTANCE_METHODS.reject { |m| m =~ /^__.*__$/ || m == :object_id }
+ OBJECT_METHODS = STANDARD_OBJECT_PUBLIC_INSTANCE_METHODS.reject { |m| m =~ /^__.*__$/ || [:object_id, :method_missing, :singleton_method_undefined, :initialize, :String, :singleton_method_added].include?(m) }
end
def test_should_be_able_to_mock_standard_object_methods
mock = build_mock
OBJECT_METHODS.each { |method| mock.__expects__(method.to_sym).returns(method) }