Class: HTMLSelector
- Inherits:
-
Object
- Object
- HTMLSelector
- Defined in:
- lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#selector ⇒ Object
readonly
Returns the value of attribute selector.
-
#tests ⇒ Object
readonly
Returns the value of attribute tests.
Instance Method Summary collapse
-
#initialize(values, previous_selection = nil, &root_fallback) ⇒ HTMLSelector
constructor
A new instance of HTMLSelector.
- #select ⇒ Object
Constructor Details
#initialize(values, previous_selection = nil, &root_fallback) ⇒ HTMLSelector
Returns a new instance of HTMLSelector.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb', line 7 def initialize(values, previous_selection = nil, &root_fallback) @values = values @root = extract_root(previous_selection, root_fallback) @selector = extract_selector @tests = extract_equality_tests @message = @values.shift if @values.shift raise ArgumentError, "Not expecting that last argument, you either have too many arguments, or they're the wrong type" end end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
5 6 7 |
# File 'lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb', line 5 def @message end |
#selector ⇒ Object (readonly)
Returns the value of attribute selector.
5 6 7 |
# File 'lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb', line 5 def selector @selector end |
#tests ⇒ Object (readonly)
Returns the value of attribute tests.
5 6 7 |
# File 'lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb', line 5 def tests @tests end |
Instance Method Details
#select ⇒ Object
19 20 21 |
# File 'lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb', line 19 def select filter @root.css(selector, context) end |