File tree Expand file tree Collapse file tree 1 file changed +32
-9
lines changed Expand file tree Collapse file tree 1 file changed +32
-9
lines changed Original file line number Diff line number Diff line change 22
22
end
23
23
24
24
context 'create' do
25
+ #
26
+ # lets
27
+ #
28
+
29
+ let ( :b_class ) {
30
+ Class . new
31
+ }
32
+
33
+ let ( :c_class ) {
34
+ Class . new
35
+ }
36
+
25
37
context 'returns nil' do
26
38
before ( :each ) do
27
- allow ( module_set ) . to receive ( :create ) . and_return ( nil )
39
+ hide_const ( 'A::Rank' )
40
+ allow ( module_set ) . to receive ( :create ) . with ( 'a' ) . and_return ( nil )
41
+
42
+ stub_const ( 'B' , b_class )
43
+ stub_const ( 'B::Rank' , Msf ::LowRanking )
44
+ allow ( module_set ) . to receive ( :create ) . with ( 'b' ) . and_return ( b_class . new )
45
+
46
+ stub_const ( 'C' , c_class )
47
+ stub_const ( 'C::Rank' , Msf ::AverageRanking )
48
+ allow ( module_set ) . to receive ( :create ) . with ( 'c' ) . and_return ( c_class . new )
28
49
end
29
50
30
51
specify {
31
52
expect {
32
53
rank_modules
33
54
} . not_to raise_error
34
55
}
56
+
57
+ it 'is ranked as Manual' do
58
+ expect ( rank_modules ) . to eq (
59
+ [
60
+ [ 'c' , Msf ::SymbolicModule ] ,
61
+ [ 'b' , Msf ::SymbolicModule ] ,
62
+ [ 'a' , Msf ::SymbolicModule ]
63
+ ]
64
+ )
65
+ end
35
66
end
36
67
37
68
context 'does not return nil' do
43
74
Class . new
44
75
}
45
76
46
- let ( :b_class ) {
47
- Class . new
48
- }
49
-
50
- let ( :c_class ) {
51
- Class . new
52
- }
53
-
54
77
#
55
78
# Callbacks
56
79
#
You can’t perform that action at this time.
0 commit comments