From 3fff6cabce3aae1ac2812503cdb357ede06af2ba Mon Sep 17 00:00:00 2001 From: Luke Imhoff Date: Tue, 20 Oct 2015 10:29:23 -0500 Subject: [PATCH] should_not == -> expect().not_to eq MSP-13484 --- .../abstract_adapter/connection_pool_spec.rb | 2 +- spec/lib/msf/core/exploit/http/client_spec.rb | 6 +++--- spec/lib/msf/core/modules/loader/base_spec.rb | 12 ++++++------ spec/lib/rex/sslscan/result_spec.rb | 4 ++-- .../shared/examples/msf/db_manager/session.rb | 4 ++-- .../shared/examples/msf/module_manager/loading.rb | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/spec/lib/active_record/connection_adapters/abstract_adapter/connection_pool_spec.rb b/spec/lib/active_record/connection_adapters/abstract_adapter/connection_pool_spec.rb index b9be0ab0dc..c1466fe210 100644 --- a/spec/lib/active_record/connection_adapters/abstract_adapter/connection_pool_spec.rb +++ b/spec/lib/active_record/connection_adapters/abstract_adapter/connection_pool_spec.rb @@ -50,7 +50,7 @@ RSpec.describe ActiveRecord::ConnectionAdapters::ConnectionPool do context 'in thread without connection' do it 'should be false' do thread = Thread.new do - Thread.current.should_not == main_thread + expect(Thread.current).not_to eq main_thread expect(active_connection?).to be_falsey end diff --git a/spec/lib/msf/core/exploit/http/client_spec.rb b/spec/lib/msf/core/exploit/http/client_spec.rb index 69aed1354c..6aa474a50b 100644 --- a/spec/lib/msf/core/exploit/http/client_spec.rb +++ b/spec/lib/msf/core/exploit/http/client_spec.rb @@ -139,7 +139,7 @@ RSpec.describe Msf::Exploit::Remote::HttpClient do end it "should not have a trailing '/'" do - unnormalized_uri[-1, 1].should_not == '/' + expect(unnormalized_uri[-1, 1]).not_to eq '/' end it "should return original string" do @@ -190,7 +190,7 @@ RSpec.describe Msf::Exploit::Remote::HttpClient do end it "should not have trailing '/'" do - unnormalized_uri[-1, 1].should_not == '/' + expect(unnormalized_uri[-1, 1]).not_to eq '/' end it "should add starting '/'" do @@ -198,7 +198,7 @@ RSpec.describe Msf::Exploit::Remote::HttpClient do end it "should add trailing '/'" do - normalized_uri[-1, 1].should_not == '/' + expect(normalized_uri[-1, 1]).not_to eq '/' end end end diff --git a/spec/lib/msf/core/modules/loader/base_spec.rb b/spec/lib/msf/core/modules/loader/base_spec.rb index 7eaf935d69..e8833dfa6d 100644 --- a/spec/lib/msf/core/modules/loader/base_spec.rb +++ b/spec/lib/msf/core/modules/loader/base_spec.rb @@ -853,7 +853,7 @@ RSpec.describe Msf::Modules::Loader::Base do non_module_extension = '.c' path = "path/with/wrong/extension#{non_module_extension}" - non_module_extension.should_not == described_class::MODULE_EXTENSION + expect(non_module_extension).not_to eq described_class::MODULE_EXTENSION subject.send(:module_path?, path).should be_falsey end @@ -968,7 +968,7 @@ RSpec.describe Msf::Modules::Loader::Base do it 'should create a new namespace module for the block' do subject.send(:namespace_module_transaction, module_full_name) do |namespace_module| - namespace_module.should_not == @existent_namespace_module + expect(namespace_module).not_to eq @existent_namespace_module expect { namespace_module::Metasploit3 @@ -995,7 +995,7 @@ RSpec.describe Msf::Modules::Loader::Base do current_constant = Msf::Modules.const_get(relative_name) current_constant.should == namespace_module - current_constant.should_not == @existent_namespace_module + expect(current_constant).not_to eq @existent_namespace_module raise error_class, error_message end @@ -1022,7 +1022,7 @@ RSpec.describe Msf::Modules::Loader::Base do current_constant = Msf::Modules.const_get(relative_name) current_constant.should == namespace_module - current_constant.should_not == @existent_namespace_module + expect(current_constant).not_to eq @existent_namespace_module false end @@ -1048,7 +1048,7 @@ RSpec.describe Msf::Modules::Loader::Base do current_constant = Msf::Modules.const_get(relative_name) current_constant.should_not be_nil - current_constant.should_not == @existent_namespace_module + expect(current_constant).not_to eq @existent_namespace_module end it 'should return true' do @@ -1292,7 +1292,7 @@ RSpec.describe Msf::Modules::Loader::Base do end it 'should restore the module to the constant' do - parent_module.const_get(relative_name).should_not == @original_namespace_module + expect(parent_module.const_get(relative_name)).not_to eq @original_namespace_module subject.send(:restore_namespace_module, parent_module, relative_name, @original_namespace_module) diff --git a/spec/lib/rex/sslscan/result_spec.rb b/spec/lib/rex/sslscan/result_spec.rb index fbfb4e006e..f1ce3f7142 100644 --- a/spec/lib/rex/sslscan/result_spec.rb +++ b/spec/lib/rex/sslscan/result_spec.rb @@ -302,7 +302,7 @@ RSpec.describe Rex::SSLScan::Result do it "should return only the ciphers for the specified version" do subject.each_accepted([:SSLv3,:TLSv1]) do |cipher_details| - cipher_details[:version].should_not == :SSLv2 + expect(cipher_details[:version]).not_to eq :SSLv2 end end end @@ -358,7 +358,7 @@ RSpec.describe Rex::SSLScan::Result do it "should return only the ciphers for the specified version" do subject.each_rejected([:SSLv3,:TLSv1]) do |cipher_details| - cipher_details[:version].should_not == :SSLv2 + expect(cipher_details[:version]).not_to eq :SSLv2 end end end diff --git a/spec/support/shared/examples/msf/db_manager/session.rb b/spec/support/shared/examples/msf/db_manager/session.rb index d2192db96f..ebaef13d92 100644 --- a/spec/support/shared/examples/msf/db_manager/session.rb +++ b/spec/support/shared/examples/msf/db_manager/session.rb @@ -471,7 +471,7 @@ shared_examples_for 'Msf::DBManager::Session' do end it "should not have session.via_exploit of 'exploit/multi/handler'" do - session.via_exploit.should_not == 'exploit/multi/handler' + expect(session.via_exploit).not_to eq 'exploit/multi/handler' end it { expect(subject.via_exploit).to eq(session.via_exploit) } @@ -814,7 +814,7 @@ shared_examples_for 'Msf::DBManager::Session' do end it "should not have session.via_exploit of 'exploit/multi/handler'" do - session.via_exploit.should_not == 'exploit/multi/handler' + expect(session.via_exploit).not_to eq 'exploit/multi/handler' end it { expect(subject.via_exploit).to eq(session.via_exploit) } diff --git a/spec/support/shared/examples/msf/module_manager/loading.rb b/spec/support/shared/examples/msf/module_manager/loading.rb index 7c492100ed..4fc1486318 100644 --- a/spec/support/shared/examples/msf/module_manager/loading.rb +++ b/spec/support/shared/examples/msf/module_manager/loading.rb @@ -55,7 +55,7 @@ shared_examples_for 'Msf::ModuleManager::Loading' do :modification_time => cached_modification_time } - cached_modification_time.should_not == modification_time + expect(cached_modification_time).not_to eq modification_time subject.file_changed?(module_path).should be_truthy end end