Class: Fakes::ArgMatchFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/fakes/arg_matching/arg_match_factory.rb

Class Method Summary collapse

Class Method Details

.create_arg_matcher_using(args) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/fakes/arg_matching/arg_match_factory.rb', line 3

def self.create_arg_matcher_using(args)
  combined_matcher = CombinedArgMatcher.new      
  args.each do|arg|
    matcher = arg.respond_to?(:matches?) ? arg : RegularArgMatcher.new(arg)
    combined_matcher << matcher
  end
  combined_matcher
end