From c55791d03ccb35432fa3e5d1901f615b08df26c4 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 24 Oct 2008 09:25:05 +0000 Subject: * test/ruby/test_array.rb (TestArray#test_join): should restore global variable after the test. [ruby-dev:36896] * test/ruby/test_hash.rb (TestHash#test_to_s): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_array.rb | 6 ++++-- test/ruby/test_hash.rb | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'test/ruby') diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index 69544cfc5..1b917ca77 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -814,6 +814,8 @@ class TestArray < Test::Unit::TestCase s = a.join assert_equal(true, s.tainted?) assert_equal(true, s.untrusted?) + ensure + $, = nil end def test_last @@ -1220,8 +1222,8 @@ class TestArray < Test::Unit::TestCase $, = ":" a = @cls[1, 2, 3] assert_equal("[1, 2, 3]", a.to_s) - - $, = "" + ensure + $, = nil end def test_uniq diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb index de0ba37fb..5a17ac4fb 100644 --- a/test/ruby/test_hash.rb +++ b/test/ruby/test_hash.rb @@ -627,6 +627,7 @@ class TestHash < Test::Unit::TestCase assert_equal(h.inspect, h.to_s) h = @cls[] assert_equal(h.inspect, h.to_s) + ensure $, = nil end -- cgit