spec/lib/xdr/var_opaque_spec.rb in xdr-2.0.0 vs spec/lib/xdr/var_opaque_spec.rb in xdr-3.0.0
- old
+ new
@@ -13,9 +13,16 @@
it "raises a ReadError when the encoded length is greater than the allowed max" do
expect{ read "\x00\x00\x00\x03\x00\x00\x00\x00" }.to raise_error(XDR::ReadError)
end
+
+ it "raises a ReadError when the padding isn't zeros" do
+ expect{ read "\x00\x00\x00\x01\x01\x00\x00\x01" }.to raise_error(XDR::ReadError)
+ expect{ read "\x00\x00\x00\x01\x01\x00\x01\x00" }.to raise_error(XDR::ReadError)
+ expect{ read "\x00\x00\x00\x01\x01\x01\x00\x00" }.to raise_error(XDR::ReadError)
+ end
+
def read(str)
io = StringIO.new(str)
subject.read(io)
end
end
\ No newline at end of file