Method: Screenplay::TestActor#play

Defined in:
lib/screenplay/actors/test.rb

#play(params, input) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/screenplay/actors/test.rb', line 31

def play(params, input)
  params.each { | key, values |
    values.each { | test, b |
      expects = !test.to_s.start_with?('not-')
      test = test.to_s[4..-1] unless expects
      method = "test_#{test}".to_sym
      raise UnknownTestException.new(test) if !respond_to?(method)
      a = input.get_value_from_path(key)
      raise TestFailedException.new(test, a, b) unless (public_send(method, a, b) == expects)
    }
  }
  return input
end