Class: BuiltIn::Change

Inherits:
Object
  • Object
show all
Defined in:
lib/watirsplash/rspec_patches.rb

Instance Method Summary collapse

Instance Method Details

#matches?(event_proc) ⇒ Boolean

Returns:

  • (Boolean)


106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/watirsplash/rspec_patches.rb', line 106

def matches?(event_proc)
  raise_block_syntax_error if block_given?

  # to make #change work with #in(timeout) method
  unless defined? @actual_before
    @actual_before = evaluate_value_proc
    event_proc.call
  end
  @actual_after = evaluate_value_proc

  (!change_expected? || changed?) && matches_before? && matches_after? && matches_expected_delta? && matches_min? && matches_max?
end