File tree Expand file tree Collapse file tree 1 file changed +46
-1
lines changed Expand file tree Collapse file tree 1 file changed +46
-1
lines changed Original file line number Diff line number Diff line change 35
35
end
36
36
37
37
context 'does not return nil' do
38
+ #
39
+ # lets
40
+ #
41
+
42
+ let ( :a_class ) {
43
+ Class . new
44
+ }
45
+
46
+ let ( :b_class ) {
47
+ Class . new
48
+ }
49
+
50
+ let ( :c_class ) {
51
+ Class . new
52
+ }
53
+
54
+ #
55
+ # Callbacks
56
+ #
57
+
58
+ before ( :each ) do
59
+ allow ( module_set ) . to receive ( :create ) . with ( 'a' ) . and_return ( a_class . new )
60
+ allow ( module_set ) . to receive ( :create ) . with ( 'b' ) . and_return ( b_class . new )
61
+ allow ( module_set ) . to receive ( :create ) . with ( 'c' ) . and_return ( c_class . new )
62
+ end
63
+
38
64
context 'with Rank' do
39
- it 'is ranked using Rank'
65
+ before ( :each ) do
66
+ stub_const ( 'A' , a_class )
67
+ stub_const ( 'A::Rank' , Msf ::LowRanking )
68
+
69
+ stub_const ( 'B' , b_class )
70
+ stub_const ( 'B::Rank' , Msf ::AverageRanking )
71
+
72
+ stub_const ( 'C' , c_class )
73
+ stub_const ( 'C::Rank' , Msf ::GoodRanking )
74
+ end
75
+
76
+ it 'is ranked using Rank' do
77
+ expect ( rank_modules ) . to eq (
78
+ [
79
+ [ 'c' , Msf ::SymbolicModule ] ,
80
+ [ 'b' , Msf ::SymbolicModule ] ,
81
+ [ 'a' , Msf ::SymbolicModule ]
82
+ ]
83
+ )
84
+ end
40
85
end
41
86
42
87
context 'without Rank' do
You can’t perform that action at this time.
0 commit comments