summaryrefslogtreecommitdiff
path: root/test/ruby/test_refinement.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-01 02:24:11 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-01 02:24:11 +0000
commit2eb2367593cc59585ce6d2ef60fba2d34b784da3 (patch)
treeb52e519c79f72413b75dd391aaf76b8f23aa3ab2 /test/ruby/test_refinement.rb
parentdbb55956496984550f1144781cac75f1d7f82afd (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/test_refinement.rb')
-rw-r--r--test/ruby/test_refinement.rb15
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)