File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 47
47
end
48
48
49
49
context "when file contains a valid stream" do
50
- it "returns an Stream " do
50
+ it "prints the stream contents " do
51
51
expect ( File ) . to receive ( :new ) do
52
52
contents = valid_stream
53
53
StringIO . new ( contents )
54
54
end
55
55
deserializer . file = 'sample'
56
- expect ( deserializer . run ) . to be_an ( Rex ::Java ::Serialization ::Model ::Stream )
56
+ deserializer . run
57
+ expect ( $stdout. string ) . to include ( '[7e0001] NewArray { char, ["97", "98"] }' )
57
58
end
58
59
end
59
60
60
61
context "when file contains an invalid stream" do
61
- it "returns nil " do
62
+ it "prints the error while deserializing " do
62
63
expect ( File ) . to receive ( :new ) do
63
64
contents = 'invalid_stream'
64
65
StringIO . new ( contents )
65
66
end
66
67
deserializer . file = 'sample'
67
- expect ( deserializer . run ) . to be_nil
68
+ deserializer . run
69
+ expect ( $stdout. string ) . to include ( '[-] Failed to unserialize Stream' )
68
70
end
69
71
end
72
+
70
73
end
71
74
end
You can’t perform that action at this time.
0 commit comments