mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_refinement.rb: test for r59946
* test/ruby/test_refinement.rb (test_dsym_literal): test for r59946, interning dynamic symbol should not be affected by refinements too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
dbb5595649
commit
2eb2367593
1 changed files with 15 additions and 0 deletions
|
@ -1995,6 +1995,21 @@ class TestRefinement < Test::Unit::TestCase
|
|||
assert_predicate(ToString.new.taint.string, :tainted?)
|
||||
end
|
||||
|
||||
class ToSymbol
|
||||
c = self
|
||||
using Module.new {refine(c) {def intern; "<#{upcase}>"; end}}
|
||||
def symbol
|
||||
:"#{@string}"
|
||||
end
|
||||
def initialize(string)
|
||||
@string = string
|
||||
end
|
||||
end
|
||||
|
||||
def test_dsym_literal
|
||||
assert_equal(:foo, ToSymbol.new("foo").symbol)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def eval_using(mod, s)
|
||||
|
|
Loading…
Reference in a new issue