mirror of
https://github.com/ruby/ruby.git
synced 2025-09-21 03:24:00 +02:00
variable.c: show namespace
* variable.c (rb_const_set): show namespace in warning messages. [Feature #7190] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5cab66cbcf
commit
f77c97a8ca
3 changed files with 12 additions and 2 deletions
|
@ -1,3 +1,4 @@
|
|||
# -*- coding: us-ascii -*-
|
||||
require 'test/unit'
|
||||
|
||||
class TestConst < Test::Unit::TestCase
|
||||
|
@ -50,7 +51,7 @@ class TestConst < Test::Unit::TestCase
|
|||
c = Class.new
|
||||
c.const_set(:X, 1)
|
||||
assert_output(nil, <<-WARNING) {c.const_set(:X, 2)}
|
||||
#{__FILE__}:#{__LINE__-1}: warning: already initialized constant X
|
||||
#{__FILE__}:#{__LINE__-1}: warning: already initialized constant #{c}::X
|
||||
#{__FILE__}:#{__LINE__-3}: warning: previous definition of X was here
|
||||
WARNING
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue