Class: Capybara::RSpecMatchers::HaveSelector

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

Instance Method Summary (collapse)

Methods inherited from Matcher

#wrap

Constructor Details

- (HaveSelector) initialize(*args)

Returns a new instance of HaveSelector



14
15
16
# File 'lib/capybara/rspec/matchers.rb', line 14

def initialize(*args)
  @args = args
end

Instance Method Details

- (Object) description



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

def description
  "have #{query.description}"
end

- (Boolean) does_not_match?(actual)

Returns:

  • (Boolean)


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

def does_not_match?(actual)
  wrap(actual).assert_no_selector(*@args)
end

- (Boolean) matches?(actual)

Returns:

  • (Boolean)


18
19
20
# File 'lib/capybara/rspec/matchers.rb', line 18

def matches?(actual)
  wrap(actual).assert_selector(*@args)
end

- (Object) query



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

def query
  @query ||= Capybara::Query.new(*@args)
end