Skip to content

Commit 87d1770

Browse files
committed
Green rank_modules with loaded without Rank is NormalRanking
MSP-12557
1 parent bae5810 commit 87d1770

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
@@ -161,7 +161,26 @@
161161
end
162162

163163
context 'without Rank' do
164-
it 'is ranked as Normal'
164+
before(:each) do
165+
stub_const('A', a_class)
166+
hide_const('A::Rank')
167+
168+
stub_const('B', b_class)
169+
stub_const('B::Rank', Msf::AverageRanking)
170+
171+
stub_const('C', c_class)
172+
stub_const('C::Rank', Msf::GoodRanking)
173+
end
174+
175+
it 'is ranked as Normal' do
176+
expect(rank_modules).to eq(
177+
[
178+
['c', c_class],
179+
['a', a_class],
180+
['b', b_class]
181+
]
182+
)
183+
end
165184
end
166185
end
167186
end

0 commit comments

Comments
 (0)