aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-11 06:14:16 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-11 06:14:16 +0000
commit10ba3bdd533389fbd037be26930795d80d8f7104 (patch)
tree78410f24efd4a67e6f936fe2fd7ce9dbc4ff5718 /test
parentb0c8aeeb9caa9b796892c30f6c675cc2191e89b5 (diff)
downloadruby-10ba3bdd533389fbd037be26930795d80d8f7104.tar.gz
* eval.c (top_using): remove Kernel#using, and add main.using instead.
* test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_refinement.rb30
1 files changed, 26 insertions, 4 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb
index 450a308839..9343f543f2 100644
--- a/test/ruby/test_refinement.rb
+++ b/test/ruby/test_refinement.rb
@@ -474,10 +474,32 @@ class TestRefinement < Test::Unit::TestCase
assert_equal("c", c.class_eval { 123.foo })
end
- def test_kernel_using_class
- c = Class.new
- assert_raise(TypeError) do
- using c
+ def test_main_using
+ assert_in_out_err([], <<-INPUT, %w(:C :M), [])
+ class C
+ def foo
+ :C
+ end
+ end
+
+ module M
+ refine C do
+ def foo
+ :M
+ end
+ end
+ end
+
+ c = C.new
+ p c.foo
+ using M
+ p c.foo
+ INPUT
+ end
+
+ def test_no_kernel_using
+ assert_raise(NoMethodError) do
+ using Module.new
end
end