Created
May 21, 2010 21:17
-
-
Save patrickt/409449 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Here's the current version, taken from core/encoding/converter/convpath_spec.rb | |
it "returns multiple encoding pairs when direct conversion is impossible" do | |
ec = Encoding::Converter.new('ascii','Big5') | |
ec.convpath.size.should == 2 | |
ec.convpath.first.should == [Encoding::US_ASCII, Encoding::UTF_8] | |
ec.convpath.last.should == [Encoding::UTF_8, Encoding::Big5] | |
end | |
# That spec seems to imply that the internal encoding for Strings is UTF-8, | |
# which is the case on MRI but not on other implementations. | |
# This is a version without that assumption: | |
it "returns multiple encoding pairs when direct conversion is impossible" do | |
ec = Encoding::Converter.new('ascii','Big5') | |
ec.convpath.size.should == 2 | |
ec.convpath.first.first.should == Encoding::US_ASCII | |
ec.convpath.first.last.should == ec.convpath.last.first | |
ec.convpath.last.last.should == Encoding::Big5 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment