ruby-changes:47967
From: nobu <ko1@a...>
Date: Sun, 1 Oct 2017 11:24:16 +0900 (JST)
Subject: [ruby-changes:47967] nobu:r60082 (trunk): test_refinement.rb: test for r59946
nobu 2017-10-01 11:24:11 +0900 (Sun, 01 Oct 2017) New Revision: 60082 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60082 Log: 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. Modified files: trunk/test/ruby/test_refinement.rb Index: test/ruby/test_refinement.rb =================================================================== --- test/ruby/test_refinement.rb (revision 60081) +++ test/ruby/test_refinement.rb (revision 60082) @@ -1995,6 +1995,21 @@ class TestRefinement < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/ruby/test_refinement.rb#L1995 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) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/