Class: Locator::Matcher::HaveCssClass
- Inherits:
-
Object
- Object
- Locator::Matcher::HaveCssClass
- Defined in:
- lib/locator/matcher/have_css_class.rb
Instance Attribute Summary collapse
-
#css_class ⇒ Object
readonly
Returns the value of attribute css_class.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
- #failure_message ⇒ Object
-
#initialize(css_class) ⇒ HaveCssClass
constructor
A new instance of HaveCssClass.
- #matches?(target = nil) ⇒ Boolean
- #negative_failure_message ⇒ Object
Constructor Details
#initialize(css_class) ⇒ HaveCssClass
Returns a new instance of HaveCssClass.
6 7 8 |
# File 'lib/locator/matcher/have_css_class.rb', line 6 def initialize(css_class) @css_class = css_class end |
Instance Attribute Details
#css_class ⇒ Object (readonly)
Returns the value of attribute css_class.
4 5 6 |
# File 'lib/locator/matcher/have_css_class.rb', line 4 def css_class @css_class end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
4 5 6 |
# File 'lib/locator/matcher/have_css_class.rb', line 4 def target @target end |
Instance Method Details
#failure_message ⇒ Object
15 16 17 |
# File 'lib/locator/matcher/have_css_class.rb', line 15 def "expected #{target.inspect} to include the css class #{css_class.inspect}" end |
#matches?(target = nil) ⇒ Boolean
10 11 12 13 |
# File 'lib/locator/matcher/have_css_class.rb', line 10 def matches?(target = nil) @target = target " #{target} ".include?(" #{css_class} ") end |
#negative_failure_message ⇒ Object
19 20 21 |
# File 'lib/locator/matcher/have_css_class.rb', line 19 def "expected #{target.inspect} not to include the css class #{css_class.inspect}" end |