spec/reference_spec.rb in prawn-0.1.1 vs spec/reference_spec.rb in prawn-0.1.2
- old
+ new
@@ -24,6 +24,19 @@
ref << "BT\n/F1 12 Tf\n72 712 Td\n( A stream ) Tj\nET"
ref.object.should == "1 0 obj\n<< /Length 41\n>>\nstream"+
"\nBT\n/F1 12 Tf\n72 712 Td\n( A stream ) Tj\nET" +
"\nendstream\nendobj\n"
end
+
+ it "should compress a stream upon request" do
+ ref = Prawn::Reference(2,{})
+ ref << "Hi There " * 20
+
+ cref = Prawn::Reference(2,{})
+ cref << "Hi There " * 20
+ cref.compress_stream
+
+ assert cref.stream.size < ref.stream.size,
+ "compressed stream expected to be smaller than source but wasn't"
+ cref.data[:Filter].should == :FlateDecode
+ end
end