summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-08 13:35:15 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-08 13:35:15 +0000
commit4363d0765b802e0f8322fceeb282aa1c0d3f3e8b (patch)
tree6e523d22f67402f8f0ead861e57fad68b92f4722 /test
parentbdb8607cb7549f8555fed781392231ead86d984b (diff)
* eval.c: remove Module#refinements.
* test/ruby/test_refinement.rb: remove tests for Module#refinements. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_refinement.rb63
1 files changed, 2 insertions, 61 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb
index 016aa15f19..a956535f60 100644
--- a/test/ruby/test_refinement.rb
+++ b/test/ruby/test_refinement.rb
@@ -407,52 +407,6 @@ class TestRefinement < Test::Unit::TestCase
end
end
- def test_refinements_empty
- m = Module.new
- assert(m.refinements.empty?)
- end
-
- def test_refinements_one
- c = Class.new
- c_ext = nil
- m = Module.new {
- refine c do
- c_ext = self
- end
- }
- assert_equal({c => c_ext}, m.refinements)
- end
-
- def test_refinements_two
- c1 = Class.new
- c1_ext = nil
- c2 = Class.new
- c2_ext = nil
- m = Module.new {
- refine c1 do
- c1_ext = self
- end
-
- refine c2 do
- c2_ext = self
- end
- }
- assert_equal({c1 => c1_ext, c2 => c2_ext}, m.refinements)
- end
-
- def test_refinements_duplicate_refine
- c = Class.new
- c_ext = nil
- m = Module.new {
- refine c do
- c_ext = self
- end
- refine c do
- end
- }
- assert_equal({c => c_ext}, m.refinements)
- end
-
def test_refine_without_block
c1 = Class.new
e = assert_raise(ArgumentError) {
@@ -465,26 +419,13 @@ class TestRefinement < Test::Unit::TestCase
module Inspect
module M
- refine Fixnum do
- end
+ Fixnum = refine(Fixnum) {}
end
end
def test_inspect
assert_equal("#<refinement:Fixnum@TestRefinement::Inspect::M>",
- Inspect::M.refinements[Fixnum].inspect)
-
- c = Class.new
- m = Module.new {
- refine String do
- end
- refine c do
- end
- }
- assert_equal("#<refinement:String@#{m.inspect}>",
- m.refinements[String].inspect)
- assert_equal("#<refinement:#{c.inspect}@#{m.inspect}>",
- m.refinements[c].inspect)
+ Inspect::M::Fixnum.inspect)
end
def test_using_method_cache