mirror of
https://github.com/ruby/ruby.git
synced 2025-09-23 20:44:00 +02:00
variable.c: fix private constant message
* variable.c (rb_const_search): raise with the actual class/module name which defines the private constant. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
bef96f5a3f
commit
a3cc3cc5c9
3 changed files with 9 additions and 1 deletions
|
@ -1360,6 +1360,9 @@ class TestModule < Test::Unit::TestCase
|
|||
c.const_set(:FOO, "foo")
|
||||
$VERBOSE = verbose
|
||||
assert_raise(NameError) { c::FOO }
|
||||
assert_raise_with_message(NameError, /#{c}::FOO/) do
|
||||
Class.new(c)::FOO
|
||||
end
|
||||
end
|
||||
|
||||
def test_private_constant2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue