-
-
Save dominikh/2ce65458a7d39e62ac82 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
# encoding: utf-8 | |
Encoding.default_internal = "ISO-8859-1" | |
require "minitest/autorun" | |
class EncodingTest < MiniTest::Unit::TestCase | |
def setup | |
@s = "äöü" | |
end | |
def test_encoding | |
assert_equal Encoding::UTF_8, @s.encoding | |
end | |
def test_encode_bang_no_arguments | |
@s.encode! | |
assert_equal Encoding::ISO_8859_1, @s.encoding | |
end | |
def test_encode_bang_only_hash | |
@s.encode!({:invalid => :replace, :undef => :replace}) | |
assert_equal Encoding::ISO_8859_1, @s.encoding | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment