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

ruby-changes:5085

From: mame <ko1@a...>
Date: Sun, 25 May 2008 03:56:04 +0900 (JST)
Subject: [ruby-changes:5085] Ruby:r16580 (trunk): * test/ruby/test_modules.rb (test_ancestors, test_included_modules):

mame	2008-05-25 03:55:44 +0900 (Sun, 25 May 2008)

  New Revision: 16580

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_module.rb

  Log:
    * test/ruby/test_modules.rb (test_ancestors, test_included_modules):
      ignore json mixins.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_module.rb?r1=16580&r2=16579&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=16580&r2=16579&diff_format=u

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 16579)
+++ ChangeLog	(revision 16580)
@@ -1,3 +1,8 @@
+Sun May 25 03:54:39 2008  Yusuke Endoh  <mame@t...>
+
+	* test/ruby/test_modules.rb (test_ancestors, test_included_modules):
+	  ignore json mixins.
+
 Sun May 25 02:37:25 2008  Koichi Sasada  <ko1@a...>
 
 	* eval_method.c: renamed from vm_method.c.  "vm_method.c" is included
Index: test/ruby/test_module.rb
===================================================================
--- test/ruby/test_module.rb	(revision 16579)
+++ test/ruby/test_module.rb	(revision 16580)
@@ -68,6 +68,10 @@
     list.reject {|c| c == PP::ObjectMixin }
   end
 
+  def remove_json_mixins(list)
+    list.reject {|c| c.instance_methods(false).include?(:to_json) }
+  end
+
   module Mixin
     MIXIN = 1
     def mixin
@@ -194,9 +198,10 @@
     assert_equal([User, Mixin],      User.ancestors)
     assert_equal([Mixin],            Mixin.ancestors)
 
-    assert_equal([Object, Kernel, BasicObject], remove_pp_mixins(Object.ancestors))
+    assert_equal([Object, Kernel, BasicObject],
+                 remove_json_mixins(remove_pp_mixins(Object.ancestors)))
     assert_equal([String, Comparable, Object, Kernel, BasicObject],
-                 remove_pp_mixins(String.ancestors))
+                 remove_json_mixins(remove_pp_mixins(String.ancestors)))
   end
 
   def test_class_eval
@@ -242,9 +247,10 @@
   def test_included_modules
     assert_equal([], Mixin.included_modules)
     assert_equal([Mixin], User.included_modules)
-    assert_equal([Kernel], remove_pp_mixins(Object.included_modules))
+    assert_equal([Kernel],
+                 remove_json_mixins(remove_pp_mixins(Object.included_modules)))
     assert_equal([Comparable, Kernel],
-                 remove_pp_mixins(String.included_modules))
+                 remove_json_mixins(remove_pp_mixins(String.included_modules)))
   end
 
   def test_instance_methods

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

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