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

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

Instance Method Summary collapse

Constructor Details

#initialize(actual) ⇒ CapybaraEvaluator

Returns a new instance of CapybaraEvaluator.



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

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)


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

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

#resetObject



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

def reset
  @match_results.clear
end