spec/support/shared/path_extractor.rb in arachni-1.4 vs spec/support/shared/path_extractor.rb in arachni-1.5
- old
+ new
@@ -22,26 +22,38 @@
expect(actual_results.sort).to eq results.sort
instance_eval &block if block_given?
end
end
- def doc
- Nokogiri::HTML( text )
+ def parser
+ Arachni::Parser.new(
+ Arachni::HTTP::Response.new(
+ url: 'http://localhost',
+ body: text,
+ headers: {
+ 'Content-Type' => 'text/html'
+ }
+ )
+ )
end
def actual_results
results_for( name )
end
def results_for( name )
- paths = extractors[name].new( document: doc, html: text ).run || []
+ paths = extractors[name].new( parser: parser, html: text ).run || []
paths.delete( 'http://www.w3.org/TR/REC-html40/loose.dtd' )
paths.compact.flatten
end
- module Arachni::Parser::Extractors;end
+ module Arachni::Parser::Extractors
+ end
def extractors
@path_extractors ||=
- ::Arachni::Component::Manager.new( options.paths.path_extractors, Arachni::Parser::Extractors )
+ ::Arachni::Component::Manager.new(
+ options.paths.path_extractors,
+ Arachni::Parser::Extractors
+ )
end
end