Module: Dommy::RSpec::Matchers
- Defined in:
- lib/dommy/rspec/matchers.rb
Overview
Custom RSpec matchers for asserting against Dommy DOM objects.
Defined Under Namespace
Classes: ContainDom, ContainDomText, HaveDomAttribute, HaveDomClass, MatchDomHtml
Instance Method Summary
collapse
Instance Method Details
#contain_dom(selector, text: nil, count: nil) ⇒ Object
25
26
27
|
# File 'lib/dommy/rspec/matchers.rb', line 25
def contain_dom(selector, text: nil, count: nil)
ContainDom.new(selector, text: text, count: count)
end
|
#contain_dom_text(text) ⇒ Object
29
30
31
|
# File 'lib/dommy/rspec/matchers.rb', line 29
def contain_dom_text(text)
ContainDomText.new(text)
end
|
#have_dom_attribute(name, value = UNSET) ⇒ Object
33
34
35
|
# File 'lib/dommy/rspec/matchers.rb', line 33
def have_dom_attribute(name, value = UNSET)
HaveDomAttribute.new(name, value)
end
|
#have_dom_class(class_name) ⇒ Object
37
38
39
|
# File 'lib/dommy/rspec/matchers.rb', line 37
def have_dom_class(class_name)
HaveDomClass.new(class_name)
end
|
#match_dom_html(expected_html) ⇒ Object
41
42
43
|
# File 'lib/dommy/rspec/matchers.rb', line 41
def match_dom_html(expected_html)
MatchDomHtml.new(expected_html)
end
|