From c501e1e58a10061cc7832dd31a04ecc322d1a483 Mon Sep 17 00:00:00 2001 From: Luke Imhoff Date: Thu, 16 Oct 2014 14:41:59 -0500 Subject: [PATCH] Extract Msf::Module::Rank shared examples MSP-11126 --- spec/lib/msf/core/module_spec.rb | 4 +--- spec/support/shared/examples/msf/module/rank.rb | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 spec/support/shared/examples/msf/module/rank.rb diff --git a/spec/lib/msf/core/module_spec.rb b/spec/lib/msf/core/module_spec.rb index 7100aa90d0..5edfe7ecd6 100644 --- a/spec/lib/msf/core/module_spec.rb +++ b/spec/lib/msf/core/module_spec.rb @@ -54,9 +54,6 @@ describe Msf::Module do it { is_expected.to respond_to :platform? } it { is_expected.to respond_to :platform_to_s } it { is_expected.to respond_to :privileged? } - it { is_expected.to respond_to :rank } - it { is_expected.to respond_to :rank_to_h } - it { is_expected.to respond_to :rank_to_s } it { is_expected.to respond_to :refname } it { is_expected.to respond_to :register_parent } it { is_expected.to respond_to :replicant } @@ -73,6 +70,7 @@ describe Msf::Module do it_should_behave_like 'Msf::Module::ModuleInfo' it_should_behave_like 'Msf::Module::ModuleStore' it_should_behave_like 'Msf::Module::Options' + it_should_behave_like 'Msf::Module::Rank' it_should_behave_like 'Msf::Module::Type' it_should_behave_like 'Msf::Module::UI' diff --git a/spec/support/shared/examples/msf/module/rank.rb b/spec/support/shared/examples/msf/module/rank.rb new file mode 100644 index 0000000000..823aa2a81a --- /dev/null +++ b/spec/support/shared/examples/msf/module/rank.rb @@ -0,0 +1,15 @@ +shared_examples_for 'Msf::Module::Rank' do + it { is_expected.to respond_to :rank } + it { is_expected.to respond_to :rank_to_h } + it { is_expected.to respond_to :rank_to_s } + + context 'class' do + subject { + described_class + } + + it { is_expected.to respond_to :rank } + it { is_expected.to respond_to :rank_to_h } + it { is_expected.to respond_to :rank_to_s } + end +end \ No newline at end of file