From 6a54f0ac4c9580bed98a813f9aed0532aef40b0d Mon Sep 17 00:00:00 2001 From: Luke Imhoff Date: Tue, 7 Oct 2014 15:49:42 -0500 Subject: [PATCH] Spec methods from db_manager.rb MSP-11466 --- spec/lib/msf/db_manager_spec.rb | 39 +++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/spec/lib/msf/db_manager_spec.rb b/spec/lib/msf/db_manager_spec.rb index 4a928be6ee..5a50b321f4 100644 --- a/spec/lib/msf/db_manager_spec.rb +++ b/spec/lib/msf/db_manager_spec.rb @@ -21,6 +21,18 @@ describe Msf::DBManager do it_should_behave_like 'Msf::DBManager::Migration' it_should_behave_like 'Msf::DBManager::ImportMsfXml' + context 'CONSTANTS' do + context 'ADAPTER' do + subject(:adapter) { + described_class::ADAPTER + } + + it { is_expected.to eq('postgresql') } + end + end + + it { is_expected.to respond_to :active } + context '#add_rails_engine_migration_paths' do def add_rails_engine_migration_paths db_manager.add_rails_engine_migration_paths @@ -39,6 +51,23 @@ describe Msf::DBManager do end end + it { is_expected.to respond_to :after_establish_connection } + it { is_expected.to respond_to :connect } + it { is_expected.to respond_to :connection_established? } + it { is_expected.to respond_to :create_db } + it { is_expected.to respond_to :disconnect } + it { is_expected.to respond_to :driver } + it { is_expected.to respond_to :drivers } + it { is_expected.to respond_to :drivers= } + it { is_expected.to respond_to :error } + it { is_expected.to respond_to :initialize_adapter } + it { is_expected.to respond_to :initialize_database_support } + it { is_expected.to respond_to :initialize_sink } + it { is_expected.to respond_to :modules_cached } + it { is_expected.to respond_to :modules_cached= } + it { is_expected.to respond_to :modules_cached } + it { is_expected.to respond_to :modules_cached= } + context '#purge_all_module_details' do def purge_all_module_details db_manager.purge_all_module_details @@ -106,6 +135,8 @@ describe Msf::DBManager do end end + it { is_expected.to respond_to :queue } + context '#remove_module_details' do def remove_module_details db_manager.remove_module_details(mtype, refname) @@ -1217,6 +1248,8 @@ describe Msf::DBManager do end end + it { is_expected.to respond_to :sink } + context '#update_all_module_details' do def update_all_module_details db_manager.update_all_module_details @@ -1788,4 +1821,10 @@ describe Msf::DBManager do end end end + + it { is_expected.to respond_to :usable } + it { is_expected.to respond_to :usable= } + it { is_expected.to respond_to :warn_about_rubies } + it { is_expected.to respond_to :workspace } + it { is_expected.to respond_to :workspace= } end