Module: Locator::Matcher

Included in:
Assertions
Defined in:
lib/locator/matcher.rb,
lib/locator/matcher/have_tag.rb,
lib/locator/matcher/have_css_class.rb

Defined Under Namespace

Classes: HaveCssClass, HaveTag

Instance Method Summary collapse

Instance Method Details

#contain(*args) ⇒ Object

Matches an HTML document with whatever string is given



7
8
9
# File 'lib/locator/matcher.rb', line 7

def contain(*args)
  HaveTag.new(*args)
end

#have_css(css, options = {}, &block) ⇒ Object



19
20
21
# File 'lib/locator/matcher.rb', line 19

def have_css(css, options = {}, &block)
  HaveTag.new(options.delete(:content), options.merge(:css => css), &block)
end

#have_css_class(css_class) ⇒ Object



23
24
25
# File 'lib/locator/matcher.rb', line 23

def have_css_class(css_class)
  HaveCssClass.new(css_class)
end

#have_tag(*args, &block) ⇒ Object



11
12
13
# File 'lib/locator/matcher.rb', line 11

def have_tag(*args, &block)
  HaveTag.new(*args, &block)
end

#have_xpath(xpath, options = {}, &block) ⇒ Object



15
16
17
# File 'lib/locator/matcher.rb', line 15

def have_xpath(xpath, options = {}, &block)
  HaveTag.new(options.delete(:content), options.merge(:xpath => xpath), &block)
end