1
0
Fork 0
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:
nobu 2017-10-01 02:24:11 +00:00
parent dbb5595649
commit 2eb2367593

View file

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