Skip to content

Commit cd133a9

Browse files
committed
don't use force_encoding in ruby 1.8
1 parent 8b8029c commit cd133a9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

spec/pairtree/pairtree_encoding_spec.rb

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ def roundtrip(id, expected_encoded=nil, expected_path=nil)
1313
path = Pairtree::Path.id_to_path(id)
1414
path.should == expected_path
1515
end
16-
Pairtree::Identifier.decode(encoded).force_encoding("UTF-8").should == id
16+
str = Pairtree::Identifier.decode(encoded)
17+
18+
if str.respond_to? :force_encoding
19+
str.force_encoding("UTF-8")
20+
end
21+
22+
str.should == id
1723
end
1824

1925
it "should handle a" do

0 commit comments

Comments
 (0)