aboutsummaryrefslogtreecommitdiffstats
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
commit258c061faba70db89bba6e25f6e0c9b08f7258bc (patch)
treeb52e519c79f72413b75dd391aaf76b8f23aa3ab2
parente689ee01a0e14c95252fe508e785fec909af0811 (diff)
downloadruby-258c061faba70db89bba6e25f6e0c9b08f7258bc.tar.gz
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
-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)