[前][次][番号順一覧][スレッド一覧]

ruby-changes:7226

From: naruse <ko1@a...>
Date: Thu, 21 Aug 2008 08:00:33 +0900 (JST)
Subject: [ruby-changes:7226] Ruby:r18745 (trunk): * test/iconv/test_option.rb (test_ignore_option): skip if iconv

naruse	2008-08-21 08:00:01 +0900 (Thu, 21 Aug 2008)

  New Revision: 18745

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18745

  Log:
    * test/iconv/test_option.rb (test_ignore_option): skip if iconv
      doesn't have transliterate.
    
    * test/iconv/test_option.rb (test_translit_option): ditto.

  Modified files:
    trunk/ChangeLog
    trunk/test/iconv/test_option.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 18744)
+++ ChangeLog	(revision 18745)
@@ -1,3 +1,10 @@
+Thu Aug 21 07:59:04 2008  NARUSE, Yui  <naruse@r...>
+
+	* 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@r...>
 
 	* lib/scanf.rb (Scanf::FormatSpecifier#initialize): %i should accept
Index: test/iconv/test_option.rb
===================================================================
--- test/iconv/test_option.rb	(revision 18744)
+++ test/iconv/test_option.rb	(revision 18745)
@@ -2,7 +2,12 @@
 
 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 @@
   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)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]