Skip to content

Commit 65a40a9

Browse files
committed
Green rank_modules use NormalRanking without Rank in loaded modules
MSP-12557
1 parent d57cf8f commit 65a40a9

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

spec/lib/msf/core/module_set_spec.rb

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,26 @@
8585
end
8686

8787
context 'without Rank' do
88-
it 'is ranked as Normal'
88+
before(:each) do
89+
stub_const('A', a_class)
90+
hide_const('A::Rank')
91+
92+
stub_const('B', b_class)
93+
stub_const('B::Rank', Msf::AverageRanking)
94+
95+
stub_const('C', c_class)
96+
stub_const('C::Rank', Msf::GoodRanking)
97+
end
98+
99+
it 'is ranked as Normal' do
100+
expect(rank_modules).to eq(
101+
[
102+
['c', Msf::SymbolicModule],
103+
['a', Msf::SymbolicModule],
104+
['b', Msf::SymbolicModule]
105+
]
106+
)
107+
end
89108
end
90109
end
91110
end

0 commit comments

Comments
 (0)