lib/bogus/verifies_stub_definition.rb in bogus-0.1.0 vs lib/bogus/verifies_stub_definition.rb in bogus-0.1.1
- old
+ new
@@ -5,11 +5,11 @@
takes :method_stringifier
def verify!(object, method_name, args)
stubbing_non_existent_method!(object, method_name) unless object.respond_to?(method_name)
return unless object.methods.include?(method_name)
- return if any_args?(args)
+ return if WithArguments.with_matcher?(args)
method = object.method(method_name)
verify_call!(method, args)
end
private
@@ -28,12 +28,8 @@
raise ArgumentError, "tried to stub #{method.name}(#{args_string}) with arguments: #{args.map(&:inspect).join(",")}"
end
def stubbing_non_existent_method!(object, method_name)
raise NameError, "#{object.inspect} does not respond to #{method_name}"
- end
-
- def any_args?(args)
- [Bogus::AnyArgs] == args
end
end
end