From 1339a862e582e3ce72917cd2f3b1a77b94b1ad53 Mon Sep 17 00:00:00 2001 From: naruse Date: Thu, 9 Oct 2008 07:33:55 +0000 Subject: [PATCH] * add test for Encoding#names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_encoding.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/ruby/test_encoding.rb b/test/ruby/test_encoding.rb index 24000796fa..9f48d30d1d 100644 --- a/test/ruby/test_encoding.rb +++ b/test/ruby/test_encoding.rb @@ -14,6 +14,15 @@ class TestEncoding < Test::Unit::TestCase assert_equal(e, Encoding.find(e.name.downcase)) end end + + def test_enc_names + aliases = Encoding.aliases + aliases.each do |a, en| + e = Encoding.find(a) + assert_equal(e.name, en) + assert(e.names.include?(a)) + end + end # Test that Encoding objects can't be copied # And that they can be compared by object_id