git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2019-04-18 09:56:03 +00:00
Родитель 4d1f86a1ff
Коммит b86d87c81a
3 изменённых файлов: 11 добавлений и 5 удалений

Просмотреть файл

@ -66,6 +66,8 @@ describe "String#split with String" do
it "defaults to $; when string isn't given or nil" do
begin
verbose = $VERBOSE
$VERBOSE = nil
old_fs = $;
[",", ":", "", "XY", nil].each do |fs|
@ -84,6 +86,7 @@ describe "String#split with String" do
end
ensure
$; = old_fs
$VERBOSE = verbose
end
end
@ -239,6 +242,8 @@ describe "String#split with Regexp" do
it "defaults to $; when regexp isn't given or nil" do
begin
verbose = $VERBOSE
$VERBOSE = nil
old_fs = $;
[/,/, /:/, //, /XY/, /./].each do |fs|
@ -257,6 +262,7 @@ describe "String#split with Regexp" do
end
ensure
$; = old_fs
$VERBOSE = verbose
end
end

Просмотреть файл

@ -25,18 +25,18 @@ describe "English" do
it "aliases $FS to $;" do
original = $;
$; = ","
suppress_warning {$; = ","}
$FS.should_not be_nil
$FS.should == $;
$; = original
suppress_warning {$; = original}
end
it "aliases $FIELD_SEPARATOR to $;" do
original = $;
$; = ","
suppress_warning {$; = ","}
$FIELD_SEPARATOR.should_not be_nil
$FIELD_SEPARATOR.should == $;
$; = original
suppress_warning {$; = original}
end
it "aliases $OFS to $," do

Просмотреть файл

@ -253,7 +253,7 @@ class TestRubyOptions < Test::Unit::TestCase
end
def test_autosplit
assert_in_out_err(%w(-an -F: -e) + ["p $F"], "foo:bar:baz\nqux:quux:quuux\n",
assert_in_out_err(%w(-W0 -an -F: -e) + ["p $F"], "foo:bar:baz\nqux:quux:quuux\n",
['["foo", "bar", "baz\n"]', '["qux", "quux", "quuux\n"]'], [])
end