File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
spec/support/shared/examples/rex/encoder/alpha2 Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 1
1
shared_examples_for 'Rex::Encoder::Alpha2::Generic' do
2
2
3
3
describe ".encode_byte" do
4
- subject { described_class . encode_byte ( block , badchars ) }
4
+ subject ( :encoded_byte ) { described_class . encode_byte ( block , badchars ) }
5
5
6
6
context "when too many badchars" do
7
7
let ( :block ) { 0x41 }
8
8
let ( :badchars ) { ( 0x00 ..0xff ) . to_a . pack ( "C*" ) }
9
9
10
10
it "raises an error" do
11
- expect { subject } . to raise_error ( RuntimeError )
11
+ expect { encoded_byte } . to raise_error ( RuntimeError )
12
12
end
13
13
end
14
14
17
17
let ( :badchars ) { 'B' }
18
18
19
19
it "returns two-bytes encoding" do
20
- expect ( subject . length ) . to eq ( 2 )
20
+ expect ( encoded_byte . length ) . to eq ( 2 )
21
21
end
22
22
23
23
it "returns encoding without badchars" do
30
30
end
31
31
32
32
describe ".encode" do
33
- subject { described_class . encode ( buf , reg , offset , badchars ) }
33
+ subject ( :encoded_result ) { described_class . encode ( buf , reg , offset , badchars ) }
34
34
let ( :buf ) { 'ABCD' }
35
35
let ( :reg ) { 'ECX' }
36
36
let ( :offset ) { 0 }
39
39
let ( :badchars ) { ( 0x00 ..0xff ) . to_a . pack ( "C*" ) }
40
40
41
41
it "raises an error" do
42
- expect { subject } . to raise_error ( RuntimeError )
42
+ expect { encoded_result } . to raise_error ( RuntimeError )
43
43
end
44
44
end
45
45
57
57
end
58
58
59
59
describe ".add_terminator" do
60
- subject { described_class . add_terminator }
60
+ subject ( :terminator ) { described_class . add_terminator }
61
61
62
62
it { is_expected . to eq ( 'AA' ) }
63
63
end
You can’t perform that action at this time.
0 commit comments