lib/rspec/mocks/test_double.rb in rspec-mocks-2.10.1 vs lib/rspec/mocks/test_double.rb in rspec-mocks-2.11.0
- old
+ new
@@ -62,12 +62,14 @@
@options = extract_options(stubs_and_options)
assign_stubs(stubs_and_options)
end
def method_missing(message, *args, &block)
- raise NoMethodError if message == :to_ary
+ raise NoMethodError if message == :to_ary
+ return 0 if message == :to_int && __mock_proxy.null_object?
__mock_proxy.record_message_received(message, *args, &block)
+
begin
__mock_proxy.null_object? ? self : super
rescue NameError
__mock_proxy.raise_unexpected_message_error(message, *args)
end
@@ -97,6 +99,5 @@
end
end
end
end
end
-