File tree Expand file tree Collapse file tree 5 files changed +30
-30
lines changed
spec/lib/rex/encoder/alpha2 Expand file tree Collapse file tree 5 files changed +30
-30
lines changed Original file line number Diff line number Diff line change 25
25
end
26
26
27
27
describe ".gen_decoder_prefix" do
28
- subject { described_class . gen_decoder_prefix ( reg , offset ) }
28
+ subject ( :decoder_prefix ) { described_class . gen_decoder_prefix ( reg , offset ) }
29
29
let ( :reg ) { 'ECX' }
30
30
let ( :offset ) { 5 }
31
31
38
38
let ( :offset ) { 0 }
39
39
40
40
it "raises an error" do
41
- expect { subject } . to raise_error ( ArgumentError )
41
+ expect { decoder_prefix } . to raise_error ( ArgumentError )
42
42
end
43
43
end
44
44
47
47
let ( :offset ) { 33 }
48
48
49
49
it "raises an error" do
50
- expect { subject } . to raise_error
50
+ expect { decoder_prefix } . to raise_error
51
51
end
52
52
end
53
53
end
54
54
55
55
56
56
describe ".gen_decoder" do
57
- subject { described_class . gen_decoder ( reg , offset ) }
57
+ subject ( :decoder ) { described_class . gen_decoder ( reg , offset ) }
58
58
let ( :reg ) { 'ECX' }
59
59
let ( :offset ) { 5 }
60
60
71
71
let ( :offset ) { 0 }
72
72
73
73
it "raises an error" do
74
- expect { subject } . to raise_error ( ArgumentError )
74
+ expect { decoder } . to raise_error ( ArgumentError )
75
75
end
76
76
end
77
77
80
80
let ( :offset ) { 33 }
81
81
82
82
it "raises an error" do
83
- expect { subject } . to raise_error
83
+ expect { decoder } . to raise_error
84
84
end
85
85
end
86
86
end
Original file line number Diff line number Diff line change 31
31
end
32
32
33
33
describe ".gen_decoder_prefix" do
34
- subject { described_class . gen_decoder_prefix ( reg , offset ) }
34
+ subject ( :decoder_prefix ) { described_class . gen_decoder_prefix ( reg , offset ) }
35
35
let ( :reg ) { 'ECX' }
36
36
let ( :offset ) { 5 }
37
37
44
44
let ( :offset ) { 0 }
45
45
46
46
it "raises an error" do
47
- expect { subject } . to raise_error ( ArgumentError )
47
+ expect { decoder_prefix } . to raise_error ( ArgumentError )
48
48
end
49
49
end
50
50
53
53
let ( :offset ) { 25 }
54
54
55
55
it "raises an error" do
56
- expect { subject } . to raise_error
56
+ expect { decoder_prefix } . to raise_error
57
57
end
58
58
end
59
59
end
60
60
61
61
62
62
describe ".gen_decoder" do
63
- subject { described_class . gen_decoder ( reg , offset ) }
63
+ subject ( :decoder ) { described_class . gen_decoder ( reg , offset ) }
64
64
let ( :reg ) { 'ECX' }
65
65
let ( :offset ) { 5 }
66
66
77
77
let ( :offset ) { 0 }
78
78
79
79
it "raises an error" do
80
- expect { subject } . to raise_error ( ArgumentError )
80
+ expect { decoder } . to raise_error ( ArgumentError )
81
81
end
82
82
end
83
83
86
86
let ( :offset ) { 25 }
87
87
88
88
it "raises an error" do
89
- expect { subject } . to raise_error
89
+ expect { decoder } . to raise_error
90
90
end
91
91
end
92
92
end
Original file line number Diff line number Diff line change 8
8
it_behaves_like 'Rex::Encoder::Alpha2::Generic'
9
9
10
10
describe ".default_accepted_chars" do
11
- subject { described_class . default_accepted_chars }
11
+ subject ( :accepted_chars ) { described_class . default_accepted_chars }
12
12
13
13
it { is_expected . to eq ( ( 'a' .. 'z' ) . to_a + ( 'B' .. 'Z' ) . to_a + ( '0' .. '9' ) . to_a ) }
14
14
end
15
15
16
16
describe ".gen_decoder_prefix" do
17
- subject { described_class . gen_decoder_prefix ( reg , offset ) }
17
+ subject ( :decoder_prefix ) { described_class . gen_decoder_prefix ( reg , offset ) }
18
18
let ( :reg ) { 'ECX' }
19
19
let ( :offset ) { 0 }
20
20
21
21
it { is_expected . to eq ( '' ) }
22
22
end
23
23
24
24
describe ".gen_decoder" do
25
- subject { described_class . gen_decoder ( reg , offset ) }
25
+ subject ( :decoder ) { described_class . gen_decoder ( reg , offset ) }
26
26
let ( :reg ) { 'ECX' }
27
27
let ( :offset ) { 0 }
28
28
29
29
it { is_expected . to eq ( '' ) }
30
30
end
31
31
32
32
describe ".gen_second" do
33
- subject { described_class . gen_second ( block , base ) }
33
+ subject ( :second ) { described_class . gen_second ( block , base ) }
34
34
let ( :block ) { 0xaf }
35
35
let ( :base ) { 0xfa }
36
36
37
37
it "returns block ^ base" do
38
- expect ( subject ^ base ) . to eq ( block )
38
+ expect ( second ^ base ) . to eq ( block )
39
39
end
40
40
end
41
41
Original file line number Diff line number Diff line change 25
25
end
26
26
27
27
describe ".gen_decoder_prefix" do
28
- subject { described_class . gen_decoder_prefix ( reg , offset ) }
28
+ subject ( :decoder_prefix ) { described_class . gen_decoder_prefix ( reg , offset ) }
29
29
let ( :reg ) { 'ECX' }
30
30
let ( :offset ) { 5 }
31
31
38
38
let ( :offset ) { 0 }
39
39
40
40
it "raises an error" do
41
- expect { subject } . to raise_error ( RuntimeError )
41
+ expect { decoder_prefix } . to raise_error ( RuntimeError )
42
42
end
43
43
end
44
44
47
47
let ( :offset ) { 22 }
48
48
49
49
it "raises an error" do
50
- expect { subject } . to raise_error
50
+ expect { decoder_prefix } . to raise_error
51
51
end
52
52
end
53
53
end
54
54
55
55
56
56
describe ".gen_decoder" do
57
- subject { described_class . gen_decoder ( reg , offset ) }
57
+ subject ( :decoder ) { described_class . gen_decoder ( reg , offset ) }
58
58
let ( :reg ) { 'ECX' }
59
59
let ( :offset ) { 5 }
60
60
71
71
let ( :offset ) { 0 }
72
72
73
73
it "raises an error" do
74
- expect { subject } . to raise_error ( RuntimeError )
74
+ expect { decoder } . to raise_error ( RuntimeError )
75
75
end
76
76
end
77
77
80
80
let ( :offset ) { 22 }
81
81
82
82
it "raises an error" do
83
- expect { subject } . to raise_error
83
+ expect { decoder } . to raise_error
84
84
end
85
85
end
86
86
end
Original file line number Diff line number Diff line change 25
25
end
26
26
27
27
describe ".default_accepted_chars" do
28
- subject { described_class . default_accepted_chars }
28
+ subject ( :accepted_chars ) { described_class . default_accepted_chars }
29
29
30
30
it { is_expected . to eq ( ( 'B' .. 'Z' ) . to_a + ( '0' .. '9' ) . to_a ) }
31
31
end
32
32
33
33
describe ".gen_decoder_prefix" do
34
- subject { described_class . gen_decoder_prefix ( reg , offset ) }
34
+ subject ( :decoder_prefix ) { described_class . gen_decoder_prefix ( reg , offset ) }
35
35
let ( :reg ) { 'ECX' }
36
36
let ( :offset ) { 5 }
37
37
44
44
let ( :offset ) { 0 }
45
45
46
46
it "raises an error" do
47
- expect ( subject ) . to be_nil
47
+ expect ( decoder_prefix ) . to be_nil
48
48
end
49
49
end
50
50
53
53
let ( :offset ) { 7 }
54
54
55
55
it "raises an error" do
56
- expect { subject } . to raise_error ( RuntimeError )
56
+ expect { decoder_prefix } . to raise_error ( RuntimeError )
57
57
end
58
58
end
59
59
end
60
60
61
61
62
62
describe ".gen_decoder" do
63
- subject { described_class . gen_decoder ( reg , offset ) }
63
+ subject ( :decoder ) { described_class . gen_decoder ( reg , offset ) }
64
64
let ( :reg ) { 'ECX' }
65
65
let ( :offset ) { 5 }
66
66
77
77
let ( :offset ) { 0 }
78
78
79
79
it "raises an error" do
80
- expect { subject } . to raise_error ( NoMethodError )
80
+ expect { decoder } . to raise_error ( NoMethodError )
81
81
end
82
82
end
83
83
86
86
let ( :offset ) { 7 }
87
87
88
88
it "raises an error" do
89
- expect { subject } . to raise_error ( RuntimeError )
89
+ expect { decoder } . to raise_error ( RuntimeError )
90
90
end
91
91
end
92
92
end
You can’t perform that action at this time.
0 commit comments