# File lib/bogus/stubbing/any_args.rb, line 13 def self.matches?(opts = {}) stubbed = opts.fetch(:stubbed) recorded = opts.fetch(:recorded) return false unless with_matcher?(stubbed) return extract(stubbed).matches?(recorded) end
# File lib/bogus/stubbing/any_args.rb, line 5 def initialize(&predicate) @predicate = predicate end
# File lib/bogus/stubbing/any_args.rb, line 20 def self.with_matcher?(args) args.first.is_a?(WithArguments) end
# File lib/bogus/stubbing/any_args.rb, line 26 def self.extract(args) args.first end
# File lib/bogus/stubbing/any_args.rb, line 9 def matches?(args) predicate.call(*args) end