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.



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

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

Instance Method Details

#matcher_matches?(matcher) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#resetObject



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

def reset
  @match_results.clear
end