diff options
author | charliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-24 10:33:05 +0000 |
---|---|---|
committer | charliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-24 10:33:05 +0000 |
commit | 988552998662dedde9e5175f733dd31f0332abf7 (patch) | |
tree | 3d6db2799c4fb4b37e45c5e4f5062e4382f05a33 /test | |
parent | f38a0630908c17056e150f5ecaf3e3ecf73e0273 (diff) | |
download | ruby-988552998662dedde9e5175f733dd31f0332abf7.tar.gz |
* variable.c (set_const_visibility): use rb_frame_this_func() instead
of rb_frame_callee() for getting the name of the called method
* test/ruby/test_module.rb: add test
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_module.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 75a7b52ca8..fa7a408ede 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -1232,6 +1232,15 @@ class TestModule < Test::Unit::TestCase assert_equal("bar", c.class_eval("BAR")) end + def test_private_constant_with_no_args + assert_in_out_err([], <<-RUBY, [], ["-:3: warning: private_constant with no argument is just ignored"]) + $-w = true + class X + private_constant + end + RUBY + end + class PrivateClass end private_constant :PrivateClass |