Permalink
Browse files

fix this font spec to check the correct encoding on M17N aware VMs

* I'm not particularly familiar with font related sections of prawn, so
  someone please correct me if I'm wrong
* Prawn::Font::TTF#encode seems to convert utf-8 strings into the
  subset specific encoding, meaning the returned strings will be tagged
  as 'binary'
* Ruby 1.9.3p194 seems to be stricter than earler releases of the 1.9
  series when comparing strings of different encodings
* See GH#357 for more detail
  • Loading branch information...
1 parent 65bcf40 commit 0ceab2766e6a2b87cc586edf0fbc5f4ddbe05160 @yob yob committed Jun 11, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 spec/font_spec.rb
View
@@ -285,8 +285,8 @@ def page_should_not_include_font(font)
it "should encode text without kerning by default" do
@activa.encode_text("To").should == [[0, "To"]]
- tele = (RUBY_VERSION < '1.9') ? "T\216l\216" :
- "T\216l\216".force_encoding("US-ASCII")
+ tele = "T\216l\216"
+ tele.force_encoding("binary") if tele.respond_to?(:force_encoding)
@activa.encode_text("Télé").should == [[0, tele]]
@activa.encode_text("Technology").should == [[0, "Technology"]]

0 comments on commit 0ceab27

Please sign in to comment.