Class: Capybara::Queries::TextQuery Private
- Defined in:
- lib/capybara/queries/text_query.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Constant Summary
Constants inherited from BaseQuery
Instance Attribute Summary
Attributes inherited from BaseQuery
Instance Method Summary collapse
- #failure_message ⇒ Object private
- 
  
    
      #initialize(*args)  ⇒ TextQuery 
    
    
  
  
  
    constructor
  
  
  
  
  
  private
  
    A new instance of TextQuery. 
- #negative_failure_message ⇒ Object private
- #resolve_for(node) ⇒ Object private
Methods inherited from BaseQuery
Constructor Details
#initialize(*args) ⇒ TextQuery
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of TextQuery.
| 6 7 8 9 10 11 12 13 14 15 16 | # File 'lib/capybara/queries/text_query.rb', line 6 def initialize(*args) @type = (args.first.is_a?(Symbol) || args.first.nil?) ? args.shift : nil @type = (.ignore_hidden_elements or .visible_text_only) ? :visible : :all if @type.nil? @expected_text, = args unless @expected_text.is_a?(Regexp) @expected_text = ::Helpers.normalize_whitespace(@expected_text) end @search_regexp = ::Helpers.to_regexp(@expected_text) ||= {} assert_valid_keys end | 
Instance Method Details
#failure_message ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
| 24 25 26 | # File 'lib/capybara/queries/text_query.rb', line 24 def (true) end | 
#negative_failure_message ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
| 28 29 30 | # File 'lib/capybara/queries/text_query.rb', line 28 def (false).sub(/(to find)/, 'not \1') end | 
#resolve_for(node) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
| 18 19 20 21 22 | # File 'lib/capybara/queries/text_query.rb', line 18 def resolve_for(node) @node = node @actual_text = text(node, @type) @count = @actual_text.scan(@search_regexp).size end |