Module: Lookout::Reception::Arguments

Defined in:
lib/lookout-3.0/reception/arguments.rb

Overview

Arguments that should be passed to a method reception expectation. Sets things up based on what kind of arguments were passed to it and may then be used to verify that arguments that don’t differ from them are subsequently passed to the method.

Defined Under Namespace

Classes: Any, Error, List, None

Class Method Summary collapse

Class Method Details

.for(*args) ⇒ Any, ...

Returns Any if ARGS is #empty?, Any or None if ARGS contain either, or a List wrapping ARGS.

Parameters:

Returns:



12
13
14
15
16
17
18
# File 'lib/lookout-3.0/reception/arguments.rb', line 12

def for(*args)
  if args.empty? then Any.new
  elsif any = args.find{ |e| Any === e } then any
  elsif none = args.find{ |e| None === e } then none
  else List.new(*args)
  end
end