diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-01 02:24:11 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-01 02:24:11 +0000 |
commit | 2eb2367593cc59585ce6d2ef60fba2d34b784da3 (patch) | |
tree | b52e519c79f72413b75dd391aaf76b8f23aa3ab2 /test/ruby | |
parent | dbb55956496984550f1144781cac75f1d7f82afd (diff) |
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
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_refinement.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb index 629fcb894b..5fba208fb7 100644 --- a/test/ruby/test_refinement.rb +++ b/test/ruby/test_refinement.rb @@ -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) |