Permalink
Browse files

spec Font#unpack

  • Loading branch information...
1 parent 5aad64a commit 628b909ea96d372c135e55ec7afd3163be8de780 @yob committed Nov 20, 2012
Showing with 15 additions and 0 deletions.
  1. +15 −0 spec/font_spec.rb
View
@@ -91,6 +91,21 @@
end
end
+ describe "unpack()" do
+ context "with a WinAnsi encoded font" do
+ let(:raw) do
+ {
+ :Encoding => :WinAnsiEncoding,
+ :Type => :Font
+ }
+ end
+ let(:font) { PDF::Reader::Font.new(object_hash, raw) }
+
+ it "should unpack a binary string into ints" do
+ font.unpack("\x41\x42").should == [65,66]
+ end
+ end
+ end
describe "glyph_width()" do
context "with a FirstChar of 1" do

0 comments on commit 628b909

Please sign in to comment.