From 65a40a994b24fba091d2ec907c400711145818b0 Mon Sep 17 00:00:00 2001 From: Luke Imhoff Date: Wed, 15 Apr 2015 15:45:21 -0500 Subject: [PATCH] Green rank_modules use NormalRanking without Rank in loaded modules MSP-12557 --- spec/lib/msf/core/module_set_spec.rb | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/spec/lib/msf/core/module_set_spec.rb b/spec/lib/msf/core/module_set_spec.rb index 725adf0b2a..00d69a2012 100644 --- a/spec/lib/msf/core/module_set_spec.rb +++ b/spec/lib/msf/core/module_set_spec.rb @@ -85,7 +85,26 @@ RSpec.describe Msf::ModuleSet do end context 'without Rank' do - it 'is ranked as Normal' + before(:each) do + stub_const('A', a_class) + hide_const('A::Rank') + + stub_const('B', b_class) + stub_const('B::Rank', Msf::AverageRanking) + + stub_const('C', c_class) + stub_const('C::Rank', Msf::GoodRanking) + end + + it 'is ranked as Normal' do + expect(rank_modules).to eq( + [ + ['c', Msf::SymbolicModule], + ['a', Msf::SymbolicModule], + ['b', Msf::SymbolicModule] + ] + ) + end end end end