diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | test/iconv/test_option.rb | 14 |
2 files changed, 19 insertions, 2 deletions
@@ -1,3 +1,10 @@ +Thu Aug 21 07:59:04 2008 NARUSE, Yui <naruse@ruby-lang.org> + + * test/iconv/test_option.rb (test_ignore_option): skip if iconv + doesn't have transliterate. + + * test/iconv/test_option.rb (test_translit_option): ditto. + Thu Aug 21 06:12:56 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> * lib/scanf.rb (Scanf::FormatSpecifier#initialize): %i should accept 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) |