Actions
Backport #5733
closedError when loading a converter
Status:
Closed
Assignee:
Description
I think this might be a bug, but I'm not sure. The following code
raises an exception:
# encoding:utf-8
require 'minitest/autorun'
class NewConverterTest < MiniTest::Unit::TestCase
def setup
@old_internal = Encoding.default_internal
@old_external = Encoding.default_external
end
def teardown
Encoding.default_internal = @old_internal
Encoding.default_external = @old_external
end
def test_iso_8859_utf_8_change_encodings
Encoding.default_internal = 'UTF-8'
Encoding.default_external = 'ISO-8859-1'
Encoding::Converter.new 'ISO-8859-1', 'UTF-8' # boom!
end
end
Exception:
1) Error:
test_iso_8859_utf_8_change_encodings(NewConverterTest):
Encoding::ConverterNotFoundError: code converter not found (ISO-8859-1 to UTF-8)
test.rb:21:in `initialize'
test.rb:21:in `new'
test.rb:21:in `test_iso_8859_utf_8_change_encodings'
/Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:976:in `run'
/Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:814:in `block in _run_suite'
/Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:807:in `map'
/Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:807:in `_run_suite'
/Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:797:in `block in _run_suites'
/Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:797:in `map'
/Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:797:in `_run_suites'
/Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:773:in `_run_anything'
/Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:936:in `run_tests'
/Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:923:in `block in _run'
/Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:922:in `each'
/Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:922:in `_run'
/Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:911:in `run'
/Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:691:in `block in autorun'
Is this intentional? If so, why? Thank you.
--
Aaron Patterson
http://tenderlovemaking.com/
Files
Actions
Like0
Like0Like0Like0