Class: Xlogin::Expectation

Inherits:
Object
  • Object
show all
Defined in:
lib/xlogin/spec.rb

Instance Method Summary collapse

Constructor Details

#initialize(session, *args) ⇒ Expectation

Returns a new instance of Expectation.



17
18
19
20
# File 'lib/xlogin/spec.rb', line 17

def initialize(session, *args)
  @session = session
  @args = args
end

Instance Method Details

#not_to_match(regexp) ⇒ Object

Raises:



27
28
29
30
# File 'lib/xlogin/spec.rb', line 27

def not_to_match(regexp)
  return unless match(regexp)
  raise ExpectationError.new(@expect, @actual)
end

#to_match(regexp) ⇒ Object

Raises:



22
23
24
25
# File 'lib/xlogin/spec.rb', line 22

def to_match(regexp)
  return if match(regexp)
  raise ExpectationError.new(@expect, @actual)
end