From 96b4491d8e4bc9ccd9eac5d7d04e0a2863a07637 Mon Sep 17 00:00:00 2001 From: Luke Imhoff Date: Thu, 9 Oct 2014 11:35:07 -0500 Subject: [PATCH] Extract Msf::DBManager::Service shared examples MSP-11124 --- spec/lib/msf/db_manager_spec.rb | 7 +------ spec/support/shared/examples/msf/db_manager/service.rb | 8 ++++++++ 2 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 spec/support/shared/examples/msf/db_manager/service.rb diff --git a/spec/lib/msf/db_manager_spec.rb b/spec/lib/msf/db_manager_spec.rb index c93ff36df2..4da0b4e2be 100644 --- a/spec/lib/msf/db_manager_spec.rb +++ b/spec/lib/msf/db_manager_spec.rb @@ -23,6 +23,7 @@ describe Msf::DBManager do it_should_behave_like 'Msf::DBManager::ImportMsfXml' it_should_behave_like 'Msf::DBManager::Migration' it_should_behave_like 'Msf::DBManager::ModuleCache' + it_should_behave_like 'Msf::DBManager::Service' it_should_behave_like 'Msf::DBManager::Sink' it_should_behave_like 'Msf::DBManager::WMAP' it_should_behave_like 'Msf::DBManager::Workspace' @@ -64,7 +65,6 @@ describe Msf::DBManager do it { is_expected.to respond_to :create_db } it { is_expected.to respond_to :creds } it { is_expected.to respond_to :dehex } - it { is_expected.to respond_to :del_service } it { is_expected.to respond_to :disconnect } it { is_expected.to respond_to :driver } it { is_expected.to respond_to :drivers } @@ -73,7 +73,6 @@ describe Msf::DBManager do it { is_expected.to respond_to :each_exploited_host } it { is_expected.to respond_to :each_loot } it { is_expected.to respond_to :each_note } - it { is_expected.to respond_to :each_service } it { is_expected.to respond_to :each_vuln } it { is_expected.to respond_to :emit } it { is_expected.to respond_to :error } @@ -85,7 +84,6 @@ describe Msf::DBManager do it { is_expected.to respond_to :find_or_create_note } it { is_expected.to respond_to :find_or_create_ref } it { is_expected.to respond_to :find_or_create_report } - it { is_expected.to respond_to :find_or_create_service } it { is_expected.to respond_to :find_or_create_task } it { is_expected.to respond_to :find_or_create_vuln } it { is_expected.to respond_to :find_qualys_asset_ports } @@ -95,7 +93,6 @@ describe Msf::DBManager do it { is_expected.to respond_to :find_vuln_by_refs } it { is_expected.to respond_to :get_client } it { is_expected.to respond_to :get_ref } - it { is_expected.to respond_to :get_service } it { is_expected.to respond_to :get_session } it { is_expected.to respond_to :get_vuln } it { is_expected.to respond_to :has_ref? } @@ -194,7 +191,6 @@ describe Msf::DBManager do it { is_expected.to respond_to :report_loot } it { is_expected.to respond_to :report_note } it { is_expected.to respond_to :report_report } - it { is_expected.to respond_to :report_service } context '#report_session' do let(:options) do @@ -849,7 +845,6 @@ describe Msf::DBManager do it { is_expected.to respond_to :reports } it { is_expected.to respond_to :rexmlify } it { is_expected.to respond_to :service_name_map } - it { is_expected.to respond_to :services } it { is_expected.to respond_to :tasks } it { is_expected.to respond_to :unserialize_object } it { is_expected.to respond_to :update_vuln_details } diff --git a/spec/support/shared/examples/msf/db_manager/service.rb b/spec/support/shared/examples/msf/db_manager/service.rb new file mode 100644 index 0000000000..df24b93ae5 --- /dev/null +++ b/spec/support/shared/examples/msf/db_manager/service.rb @@ -0,0 +1,8 @@ +shared_examples_for 'Msf::DBManager::Service' do + it { is_expected.to respond_to :del_service } + it { is_expected.to respond_to :each_service } + it { is_expected.to respond_to :find_or_create_service } + it { is_expected.to respond_to :get_service } + it { is_expected.to respond_to :report_service } + it { is_expected.to respond_to :services } +end \ No newline at end of file