Class: Capybara::RSpecMatchers::HaveCurrentPath

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

Instance Attribute Summary

Attributes inherited from Matcher

#failure_message, #failure_message_when_negated

Instance Method Summary collapse

Methods inherited from Matcher

#wrap

Methods included from Compound

#and, #and_then, #or

Constructor Details

#initialize(*args) ⇒ HaveCurrentPath

Returns a new instance of HaveCurrentPath.



183
184
185
186
# File 'lib/capybara/rspec/matchers.rb', line 183

def initialize(*args)
  @args = args
  @current_path = args.first
end

Instance Method Details

#descriptionObject



196
197
198
# File 'lib/capybara/rspec/matchers.rb', line 196

def description
  "have current path #{@current_path.inspect}"
end

#does_not_match?(actual) ⇒ Boolean

Returns:

  • (Boolean)


192
193
194
# File 'lib/capybara/rspec/matchers.rb', line 192

def does_not_match?(actual)
  wrap_does_not_match?(actual) { |el| el.assert_no_current_path(*@args) }
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


188
189
190
# File 'lib/capybara/rspec/matchers.rb', line 188

def matches?(actual)
  wrap_matches?(actual) { |el| el.assert_current_path(*@args) }
end