From 0cae739f2d3038d8d2ac6e8ee51a9a4d926dc9d5 Mon Sep 17 00:00:00 2001 From: naruse Date: Wed, 20 Aug 2008 23:00:01 +0000 Subject: * test/iconv/test_option.rb (test_ignore_option): skip if iconv doesn't have transliterate. * test/iconv/test_option.rb (test_translit_option): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/iconv/test_option.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/iconv/test_option.rb b/test/iconv/test_option.rb index 8c6df56c8f..b899ba2db1 100644 --- a/test/iconv/test_option.rb +++ b/test/iconv/test_option.rb @@ -2,7 +2,12 @@ require File.join(File.dirname(__FILE__), "utils.rb") class TestIconv::Option < TestIconv def test_ignore_option - return unless Iconv.method_defined? :transliterate? + begin + iconv = Iconv.new('SHIFT_JIS', 'EUC-JP') + iconv.transliterate? + rescue NotImplementedError + return + end iconv = Iconv.new('SHIFT_JIS', 'EUC-JP//ignore') str = iconv.iconv(EUCJ_STR) str << iconv.iconv(nil) @@ -17,7 +22,12 @@ class TestIconv::Option < TestIconv end def test_translit_option - return unless Iconv.method_defined? :transliterate? + begin + iconv = Iconv.new('SHIFT_JIS', 'EUC-JP') + iconv.transliterate? + rescue NotImplementedError + return + end iconv = Iconv.new('SHIFT_JIS', 'EUC-JP//ignore') str = iconv.iconv(EUCJ_STR) str << iconv.iconv(nil) -- cgit v1.2.3