Skip to content

Commit bae5810

Browse files
committed
Green module_ranks with loaded with Rank
MSP-12557
1 parent 65a40a9 commit bae5810

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

spec/lib/msf/core/module_set_spec.rb

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,53 @@
111111
end
112112

113113
context 'without Msf::SymbolicModule' do
114+
#
115+
# lets
116+
#
117+
118+
let(:a_class) {
119+
Class.new
120+
}
121+
122+
let(:b_class) {
123+
Class.new
124+
}
125+
126+
let(:c_class) {
127+
Class.new
128+
}
129+
130+
#
131+
# Callbacks
132+
#
133+
134+
before(:each) do
135+
module_set['a'] = a_class
136+
module_set['b'] = b_class
137+
module_set['c'] = c_class
138+
end
139+
114140
context 'with Rank' do
115-
it 'is ranked using Rank'
141+
before(:each) do
142+
stub_const('A', a_class)
143+
stub_const('A::Rank', Msf::LowRanking)
144+
145+
stub_const('B', b_class)
146+
stub_const('B::Rank', Msf::AverageRanking)
147+
148+
stub_const('C', c_class)
149+
stub_const('C::Rank', Msf::GoodRanking)
150+
end
151+
152+
it 'is ranked using Rank' do
153+
expect(rank_modules).to eq(
154+
[
155+
['c', c_class],
156+
['b', b_class],
157+
['a', a_class]
158+
]
159+
)
160+
end
116161
end
117162

118163
context 'without Rank' do

0 commit comments

Comments
 (0)