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:
nobu 2012-11-29 08:45:13 +00:00
parent 5cab66cbcf
commit f77c97a8ca
3 changed files with 12 additions and 2 deletions

View file

@ -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