Method: Screenplay::TestActor#test_regexp

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

#test_regexp(a, b) ⇒ Object



85
86
87
88
89
90
# File 'lib/screenplay/actors/test.rb', line 85

def test_regexp(a, b)
	b = Regexp.new(b.to_s) if b.is_a?(String) || b.is_a?(Symbol)
	raise UnsupportedTypeTestException.new(:regexp, b) unless b.is_a?(Regexp)
	raise UnsupportedTypeTestException.new(:regexp, a) unless a.is_a?(String)
	!a.match(b).nil?
end