spec/shared/module.rb in arachni-0.4.1.3 vs spec/shared/module.rb in arachni-0.4.2

- old
+ new

@@ -18,47 +18,47 @@ framework.modules.load name # do not dedup, the module tests need to see everything current_module.instance_eval { define_method( :skip? ) { |elem| false } } - http.headers['User-Agent'] = 'default' - @issues = [] Arachni::Module::Manager.do_not_store Arachni::Module::Manager.on_register_results_raw do |issues| issues.each { |i| @issues << i } end end after( :each ) do - Arachni::Module::ElementDB.reset + Arachni::ElementFilter.reset Arachni::Element::Capabilities::Auditable.reset Arachni::Module::Manager.results.clear Arachni::Module::Manager.do_not_store # Leave this here, helps us save every kind of issue in order to test # the reports. - #File.open( '../issues.yml', 'a' ){ |f| f.write @issues.to_yaml } + if File.exists?( "#{Dir.tmpdir}/save_issues" ) + File.open( "#{Dir.tmpdir}/issues.yml", 'a' ){ |f| f.write @issues.to_yaml } + end @issues.clear http.cookie_jar.clear framework.reset_spider framework.opts.dont_audit :links, :forms, :cookies, :headers end describe '.info' do - it 'should hold the right targets' do + it 'holds the right targets' do if current_module.info[:targets] current_module.info[:targets].sort.should == self.class.targets.sort else current_module.info[:targets].should == self.class.targets end end - it 'should hold the right elements' do + it 'holds the right elements' do if current_module.info[:elements] current_module.info[:elements].sort.should == self.class.elements.sort else current_module.info[:elements].should == self.class.elements end @@ -79,10 +79,10 @@ options.include = options.url end end elements.each do |type| - it "should log vulnerable #{type}s" do + it "logs vulnerable #{type}s" do if !issue_count && !issue_count_per_target && !issue_count_per_element raise 'No issue count provided via a suitable method.' end audit type.to_sym, run_checks