Class: Capybara::RSpecMatchers::HaveCurrentPath

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

Instance Attribute Summary collapse

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



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

def initialize(*args)
  @args = args

  # are set just for backwards compatability
  @current_path = args.first
end

Instance Attribute Details

#current_pathObject (readonly)

Returns the value of attribute current_path



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

def current_path
  @current_path
end

Instance Method Details

#descriptionObject



208
209
210
# File 'lib/capybara/rspec/matchers.rb', line 208

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

#does_not_match?(actual) ⇒ Boolean

Returns:

  • (Boolean)


204
205
206
# File 'lib/capybara/rspec/matchers.rb', line 204

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

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


200
201
202
# File 'lib/capybara/rspec/matchers.rb', line 200

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