Update java_deserializer specs
parent
5c413a8102
commit
720def9d0a
|
@ -47,6 +47,11 @@ describe JavaDeserializer do
|
|||
end
|
||||
|
||||
context "when file contains a valid stream" do
|
||||
before(:each) do
|
||||
$stdout.string = ''
|
||||
end
|
||||
|
||||
context "when no options" do
|
||||
it "prints the stream contents" do
|
||||
expect(File).to receive(:new) do
|
||||
contents = valid_stream
|
||||
|
@ -58,6 +63,19 @@ describe JavaDeserializer do
|
|||
end
|
||||
end
|
||||
|
||||
context "when :array in options" do
|
||||
it "prints the array contents" do
|
||||
expect(File).to receive(:new) do
|
||||
contents = valid_stream
|
||||
StringIO.new(contents)
|
||||
end
|
||||
deserializer.file = 'sample'
|
||||
deserializer.run({:array => '0'})
|
||||
expect($stdout.string).to include('Array Type: char')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "when file contains an invalid stream" do
|
||||
it "prints the error while deserializing" do
|
||||
expect(File).to receive(:new) do
|
||||
|
@ -69,6 +87,5 @@ describe JavaDeserializer do
|
|||
expect($stdout.string).to include('[-] Failed to unserialize Stream')
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue