Green rank_modules use NormalRanking without Rank in loaded modules

MSP-12557
bug/bundler_fix
Luke Imhoff 2015-04-15 15:45:21 -05:00
parent d57cf8f09f
commit 65a40a994b
No known key found for this signature in database
GPG Key ID: 5B1FB01FB33356F8
1 changed files with 20 additions and 1 deletions

View File

@ -85,7 +85,26 @@ RSpec.describe Msf::ModuleSet do
end end
context 'without Rank' do 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 end
end end