spec/components/plugins/headers_collector_spec.rb in arachni-1.2.1 vs spec/components/plugins/headers_collector_spec.rb in arachni-1.3

- old
+ new

@@ -9,11 +9,11 @@ context 'when no patterns are given' do it 'logs all headers' do run - actual_results.should == { + expect(actual_results).to eq({ url => { "Content-Type" => "text/html;charset=utf-8", "X-Xss-Protection" => "1; mode=block", "X-Content-Type-Options" => "nosniff", "X-Frame-Options" => "SAMEORIGIN", @@ -33,11 +33,11 @@ "X-Xss-Protection" => "1; mode=block", "X-Content-Type-Options" => "nosniff", "X-Frame-Options" => "SAMEORIGIN", "Content-Length" => "6" } - } + }) end end context 'when :include patterns are given' do it 'only logs headers whose name matches the pattern' do @@ -45,11 +45,11 @@ 'include' => 'weird|frame' } run - actual_results.should == { + expect(actual_results).to eq({ url => { "X-Frame-Options" => "SAMEORIGIN" }, "#{url}1" => { "Weird" => "Value", @@ -57,11 +57,11 @@ }, "#{url}2" => { "Weird2" => "Value2", "X-Frame-Options" => "SAMEORIGIN" } - } + }) end end context 'when :exclude patterns are given' do it 'only logs headers whose name matches the pattern' do @@ -69,11 +69,11 @@ 'exclude' => 'weird|frame' } run - actual_results.should == { + expect(actual_results).to eq({ url => { "Content-Type" => "text/html;charset=utf-8", "X-Xss-Protection" => "1; mode=block", "X-Content-Type-Options" => "nosniff", "Content-Length" => "54" @@ -88,11 +88,11 @@ "Content-Type" => "text/html;charset=utf-8", "X-Xss-Protection" => "1; mode=block", "X-Content-Type-Options" => "nosniff", "Content-Length" => "6" } - } + }) end end describe '.merge' do it 'merges the results of different instances' do @@ -110,17 +110,17 @@ 'Name22' => 'Value22' }, }, ] - framework.plugins[component_name].merge( results ).should == { + expect(framework.plugins[component_name].merge( results )).to eq({ "#{url}" => { "Name" => "Value", "Name2" => "Value2" }, "#{url}2" => { "Name22" => "Value22" } - } + }) end end end