Class: Capybara::RSpecMatchers::Compound::CapybaraEvaluator

Inherits:
Object
  • Object
show all
Defined in:
lib/capybara/rspec/compound.rb

Instance Method Summary collapse

Constructor Details

#initialize(actual) ⇒ CapybaraEvaluator

Returns a new instance of CapybaraEvaluator.



21
22
23
24
# File 'lib/capybara/rspec/compound.rb', line 21

def initialize(actual)
  @actual = actual
  @match_results = Hash.new { |h, matcher| h[matcher] = matcher.matches?(@actual) }
end

Instance Method Details

#matcher_matches?(matcher) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/capybara/rspec/compound.rb', line 26

def matcher_matches?(matcher)
  @match_results[matcher]
end

#resetObject



30
31
32
# File 'lib/capybara/rspec/compound.rb', line 30

def reset
  @match_results.clear
end