aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_string.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-02 06:12:56 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-02 06:12:56 +0000
commitb2eae8e6b933942d9d895f8b89691c8011d6d56c (patch)
tree069b06eedd427d2fd3d2c249d2d409ca6f61372b /test/ruby/test_string.rb
parentad8b04f35b4242b09e5a37624270d131e33324eb (diff)
downloadruby-b2eae8e6b933942d9d895f8b89691c8011d6d56c.tar.gz
test/ruby/test_string.rb: ensure restoring $/
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_string.rb')
-rw-r--r--test/ruby/test_string.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index 90f48e4f08..433f7743c4 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -381,6 +381,8 @@ CODE
$/ = save
assert_equal(S("a").hash, S("a\u0101").chomp(S("\u0101")).hash, '[ruby-core:22414]')
+ ensure
+ $/ = save
end
def test_chomp!
@@ -437,6 +439,8 @@ CODE
assert_equal("foo\r", s)
assert_equal(S("a").hash, S("a\u0101").chomp!(S("\u0101")).hash, '[ruby-core:22414]')
+ ensure
+ $/ = save
end
def test_chop
@@ -665,6 +669,7 @@ CODE
S("hello!world").lines.each {|x| res << x}
assert_equal(S("hello!"), res[0])
assert_equal(S("world"), res[1])
+ ensure
$/ = save
end
@@ -807,6 +812,8 @@ CODE
assert_nothing_raised(bug7646) do
"\n\u0100".each_line("\n") {}
end
+ ensure
+ $/ = save
end
def test_lines