diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-30 03:32:05 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-30 03:32:05 +0000 |
commit | 1d234a16143f26c2ea10ea35afbbb0c7c19bdeee (patch) | |
tree | 409ab4a8b960be58e53be923255526ddaaca59a2 | |
parent | 6a894686d604f62b08da02cd89cd231e5260684c (diff) | |
download | ruby-1d234a16143f26c2ea10ea35afbbb0c7c19bdeee.tar.gz |
* test/ruby/test_module.rb (TestModule): removed remove_*_mixins methods.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/ruby/test_module.rb | 39 |
1 files changed, 8 insertions, 31 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index e44ae85680..1347545fa7 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -64,29 +64,6 @@ class TestModule < Test::Unit::TestCase # Support stuff - def remove_pp_mixins(list) - list.reject {|c| c == PP::ObjectMixin } - end - - def remove_json_mixins(list) - list.reject {|c| c.to_s.start_with?("JSON") } - end - - def remove_rake_mixins(list) - list.reject {|c| - name = c.name - name.start_with?("Rake") or name.start_with?("FileUtils") - } - end - - def remove_minitest_mixins(list) - list.reject {|c| c.to_s.start_with?("MiniTest") } - end - - def remove_mkmf_mixins(list) - list.reject {|c| c.to_s.start_with?("MakeMakefile") } - end - module Mixin MIXIN = 1 def mixin @@ -224,10 +201,10 @@ class TestModule < Test::Unit::TestCase assert_equal([User, Mixin], User.ancestors) assert_equal([Mixin], Mixin.ancestors) - assert_equal([Object, Kernel, BasicObject], - remove_mkmf_mixins(remove_minitest_mixins(remove_rake_mixins(remove_json_mixins(remove_pp_mixins(Object.ancestors)))))) - assert_equal([String, Comparable, Object, Kernel, BasicObject], - remove_mkmf_mixins(remove_minitest_mixins(remove_rake_mixins(remove_json_mixins(remove_pp_mixins(String.ancestors)))))) + ancestors = Object.ancestors + mixins = ancestors - [Object, Kernel, BasicObject] + assert_equal([Object, Kernel, BasicObject], ancestors - mixins) + assert_equal([String, Comparable, Object, Kernel, BasicObject], String.ancestors - mixins) end CLASS_EVAL = 2 @@ -284,10 +261,10 @@ class TestModule < Test::Unit::TestCase def test_included_modules assert_equal([], Mixin.included_modules) assert_equal([Mixin], User.included_modules) - assert_equal([Kernel], - remove_mkmf_mixins(remove_minitest_mixins(remove_rake_mixins(remove_json_mixins(remove_pp_mixins(Object.included_modules)))))) - assert_equal([Comparable, Kernel], - remove_mkmf_mixins(remove_minitest_mixins(remove_rake_mixins(remove_json_mixins(remove_pp_mixins(String.included_modules)))))) + + mixins = Object.included_modules - [Kernel] + assert_equal([Kernel], Object.included_modules - mixins) + assert_equal([Comparable, Kernel], String.included_modules - mixins) end def test_instance_methods |