mirror of
https://github.com/ruby/ruby.git
synced 2025-09-24 04:54:01 +02:00
* 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
This commit is contained in:
parent
f38a063090
commit
9885529986
3 changed files with 17 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue