summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-04 14:34:56 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-04 14:34:56 +0000
commit205b5c9cd64a5a0d5f104159e919e82a03b10cb4 (patch)
treecfa19760f7f3751a80e38f72e98fb06c1918f0d4 /test
parent2392c12bd183241e8d255aa882f53ebd845b7dd8 (diff)
merge revision(s) 40915: [Backport #8448]
* 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 for private_constant with no args git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@41064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_module.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index 7dd5cce90f..0b47367d66 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -1192,6 +1192,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