Skip to content

Commit 191dc29

Browse files
committed
Fix java_serializer specs
1 parent d1d20ee commit 191dc29

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

spec/tools/java_deserializer_spec.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,28 @@
4747
end
4848

4949
context "when file contains a valid stream" do
50-
it "returns an Stream" do
50+
it "prints the stream contents" do
5151
expect(File).to receive(:new) do
5252
contents = valid_stream
5353
StringIO.new(contents)
5454
end
5555
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"] }')
5758
end
5859
end
5960

6061
context "when file contains an invalid stream" do
61-
it "returns nil" do
62+
it "prints the error while deserializing" do
6263
expect(File).to receive(:new) do
6364
contents = 'invalid_stream'
6465
StringIO.new(contents)
6566
end
6667
deserializer.file = 'sample'
67-
expect(deserializer.run).to be_nil
68+
deserializer.run
69+
expect($stdout.string).to include('[-] Failed to unserialize Stream')
6870
end
6971
end
72+
7073
end
7174
end

0 commit comments

Comments
 (0)