Class: RSpecHtmlMatchers::NokogiriRegexpHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec-html-matchers/nokogiri_regexp_helper.rb

Overview

for nokogiri regexp matching

Instance Method Summary collapse

Constructor Details

#initialize(regex) ⇒ NokogiriRegexpHelper

Returns a new instance of NokogiriRegexpHelper.



9
10
11
# File 'lib/rspec-html-matchers/nokogiri_regexp_helper.rb', line 9

def initialize regex
  @regex = regex
end

Instance Method Details

#regexp(node_set) ⇒ Object



13
14
15
# File 'lib/rspec-html-matchers/nokogiri_regexp_helper.rb', line 13

def regexp node_set
  node_set.find_all { |node| node.content =~ @regex }
end