Skip to content

Commit c828db5

Browse files
committed
Remove escape: true given to #ruby_exe as that is the default now
1 parent 8d83fce commit c828db5

11 files changed

+47
-47
lines changed

command_line/dash_a_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
end
77

88
it "runs the code in loop conditional on Kernel.gets()" do
9-
ruby_exe("puts $F.last", options: "-n -a", escape: true,
9+
ruby_exe("puts $F.last", options: "-n -a",
1010
args: " < #{@names}").should ==
1111
"jones\nfield\ngrey\n"
1212
end
1313

1414
it "sets $-a" do
15-
ruby_exe("puts $-a", options: "-n -a", escape: true,
15+
ruby_exe("puts $-a", options: "-n -a",
1616
args: " < #{@names}").should ==
1717
"true\ntrue\ntrue\n"
1818
end

command_line/dash_l_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@
66
end
77

88
it "chomps lines with default separator" do
9-
ruby_exe('puts $_.end_with?("\n")', options: "-n -l", escape: true,
9+
ruby_exe('puts $_.end_with?("\n")', options: "-n -l",
1010
args: " < #{@names}").should ==
1111
"false\nfalse\nfalse\n"
1212
end
1313

1414
it "chomps last line based on $/" do
15-
ruby_exe('BEGIN { $/ = "ones\n" }; puts $_', options: "-W0 -n -l", escape: true,
15+
ruby_exe('BEGIN { $/ = "ones\n" }; puts $_', options: "-W0 -n -l",
1616
args: " < #{@names}").should ==
1717
"alice j\nbob field\njames grey\n"
1818
end
1919

2020
it "sets $\\ to the value of $/" do
21-
ruby_exe("puts $\\ == $/", options: "-W0 -n -l", escape: true,
21+
ruby_exe("puts $\\ == $/", options: "-W0 -n -l",
2222
args: " < #{@names}").should ==
2323
"true\ntrue\ntrue\n"
2424
end
2525

2626
it "sets $-l" do
27-
ruby_exe("puts $-l", options: "-n -l", escape: true,
27+
ruby_exe("puts $-l", options: "-n -l",
2828
args: " < #{@names}").should ==
2929
"true\ntrue\ntrue\n"
3030
end

command_line/dash_n_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
end
77

88
it "runs the code in loop conditional on Kernel.gets()" do
9-
ruby_exe("puts $_", options: "-n", escape: true,
9+
ruby_exe("puts $_", options: "-n",
1010
args: " < #{@names}").should ==
1111
"alice\nbob\njames\n"
1212
end
1313

1414
it "only evaluates BEGIN blocks once" do
15-
ruby_exe("BEGIN { puts \"hi\" }; puts $_", options: "-n", escape: true,
15+
ruby_exe("BEGIN { puts \"hi\" }; puts $_", options: "-n",
1616
args: " < #{@names}").should ==
1717
"hi\nalice\nbob\njames\n"
1818
end
1919

2020
it "only evaluates END blocks once" do
21-
ruby_exe("puts $_; END {puts \"bye\"}", options: "-n", escape: true,
21+
ruby_exe("puts $_; END {puts \"bye\"}", options: "-n",
2222
args: " < #{@names}").should ==
2323
"alice\nbob\njames\nbye\n"
2424
end
@@ -29,7 +29,7 @@
2929
$total += 1
3030
END { puts $total }
3131
script
32-
ruby_exe(script, options: "-n", escape: true,
32+
ruby_exe(script, options: "-n",
3333
args: " < #{@names}").should ==
3434
"3\n"
3535
end

command_line/dash_p_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
end
77

88
it "runs the code in loop conditional on Kernel.gets() and prints $_" do
9-
ruby_exe("$_ = $_.upcase", options: "-p", escape: true,
9+
ruby_exe("$_ = $_.upcase", options: "-p",
1010
args: " < #{@names}").should ==
1111
"ALICE\nBOB\nJAMES\n"
1212
end
1313

1414
it "sets $-p" do
15-
ruby_exe("$_ = $-p", options: "-p", escape: true,
15+
ruby_exe("$_ = $-p", options: "-p",
1616
args: " < #{@names}").should ==
1717
"truetruetrue"
1818
end

command_line/dash_upper_f_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
end
77

88
it "specifies the field separator pattern for -a" do
9-
ruby_exe("puts $F[0]", options: "-naF:", escape: true,
9+
ruby_exe("puts $F[0]", options: "-naF:",
1010
args: " < #{@passwd}").should ==
1111
"nobody\nroot\ndaemon\n"
1212
end

command_line/rubyopt_spec.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111

1212
it "adds the -I path to $LOAD_PATH" do
1313
ENV["RUBYOPT"] = "-Ioptrubyspecincl"
14-
result = ruby_exe("puts $LOAD_PATH.grep(/byspecin/)", escape: true)
14+
result = ruby_exe("puts $LOAD_PATH.grep(/byspecin/)")
1515
result.chomp[-15..-1].should == "optrubyspecincl"
1616
end
1717

1818
it "sets $DEBUG to true for '-d'" do
1919
ENV["RUBYOPT"] = '-d'
2020
command = %[puts "value of $DEBUG is \#{$DEBUG}"]
21-
result = ruby_exe(command, escape: true, args: "2>&1")
21+
result = ruby_exe(command, args: "2>&1")
2222
result.should =~ /value of \$DEBUG is true/
2323
end
2424

@@ -36,27 +36,27 @@
3636

3737
it "sets $VERBOSE to true for '-w'" do
3838
ENV["RUBYOPT"] = '-w'
39-
ruby_exe("p $VERBOSE", escape: true).chomp.should == "true"
39+
ruby_exe("p $VERBOSE").chomp.should == "true"
4040
end
4141

4242
it "sets $VERBOSE to true for '-W'" do
4343
ENV["RUBYOPT"] = '-W'
44-
ruby_exe("p $VERBOSE", escape: true).chomp.should == "true"
44+
ruby_exe("p $VERBOSE").chomp.should == "true"
4545
end
4646

4747
it "sets $VERBOSE to nil for '-W0'" do
4848
ENV["RUBYOPT"] = '-W0'
49-
ruby_exe("p $VERBOSE", escape: true).chomp.should == "nil"
49+
ruby_exe("p $VERBOSE").chomp.should == "nil"
5050
end
5151

5252
it "sets $VERBOSE to false for '-W1'" do
5353
ENV["RUBYOPT"] = '-W1'
54-
ruby_exe("p $VERBOSE", escape: true).chomp.should == "false"
54+
ruby_exe("p $VERBOSE").chomp.should == "false"
5555
end
5656

5757
it "sets $VERBOSE to true for '-W2'" do
5858
ENV["RUBYOPT"] = '-W2'
59-
ruby_exe("p $VERBOSE", escape: true).chomp.should == "true"
59+
ruby_exe("p $VERBOSE").chomp.should == "true"
6060
end
6161

6262
it "suppresses deprecation warnings for '-W:no-deprecated'" do

core/argf/readpartial_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
print ARGF.readpartial(#{@stdin.size})
7070
ARGF.readpartial(1) rescue print $!.class
7171
STR
72-
stdin = ruby_exe(ruby_str, args: "< #{@stdin_name}", escape: true)
72+
stdin = ruby_exe(ruby_str, args: "< #{@stdin_name}")
7373
stdin.should == @stdin + "EOFError"
7474
end
7575
end

core/file/flock_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
it "returns false if trying to lock an exclusively locked file" do
3131
@file.flock File::LOCK_EX
3232

33-
ruby_exe(<<-END_OF_CODE, escape: true).should == "false"
33+
ruby_exe(<<-END_OF_CODE).should == "false"
3434
File.open('#{@name}', "w") do |f2|
3535
print f2.flock(File::LOCK_EX | File::LOCK_NB).to_s
3636
end
@@ -40,7 +40,7 @@
4040
it "blocks if trying to lock an exclusively locked file" do
4141
@file.flock File::LOCK_EX
4242

43-
out = ruby_exe(<<-END_OF_CODE, escape: true)
43+
out = ruby_exe(<<-END_OF_CODE)
4444
running = false
4545
4646
t = Thread.new do

core/kernel/exec_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
end
88

99
it "runs the specified command, replacing current process" do
10-
ruby_exe('exec "echo hello"; puts "fail"', escape: true).should == "hello\n"
10+
ruby_exe('exec "echo hello"; puts "fail"').should == "hello\n"
1111
end
1212
end
1313

1414
describe "Kernel.exec" do
1515
it "runs the specified command, replacing current process" do
16-
ruby_exe('Kernel.exec "echo hello"; puts "fail"', escape: true).should == "hello\n"
16+
ruby_exe('Kernel.exec "echo hello"; puts "fail"').should == "hello\n"
1717
end
1818
end

core/process/exec_spec.rb

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@
3434
end
3535

3636
it "runs the specified command, replacing current process" do
37-
ruby_exe('Process.exec "echo hello"; puts "fail"', escape: true).should == "hello\n"
37+
ruby_exe('Process.exec "echo hello"; puts "fail"').should == "hello\n"
3838
end
3939

4040
it "sets the current directory when given the :chdir option" do
4141
tmpdir = tmp("")[0..-2]
4242
platform_is_not :windows do
43-
ruby_exe("Process.exec(\"pwd\", chdir: #{tmpdir.inspect})", escape: true).should == "#{tmpdir}\n"
43+
ruby_exe("Process.exec(\"pwd\", chdir: #{tmpdir.inspect})").should == "#{tmpdir}\n"
4444
end
4545
platform_is :windows do
46-
ruby_exe("Process.exec(\"cd\", chdir: #{tmpdir.inspect})", escape: true).tr('\\', '/').should == "#{tmpdir}\n"
46+
ruby_exe("Process.exec(\"cd\", chdir: #{tmpdir.inspect})").tr('\\', '/').should == "#{tmpdir}\n"
4747
end
4848
end
4949

@@ -73,27 +73,27 @@
7373
platform_is_not :windows do
7474
it "subjects the specified command to shell expansion" do
7575
result = Dir.chdir(@dir) do
76-
ruby_exe('Process.exec "echo *"', escape: true)
76+
ruby_exe('Process.exec "echo *"')
7777
end
7878
result.chomp.should == @name
7979
end
8080

8181
it "creates an argument array with shell parsing semantics for whitespace" do
82-
ruby_exe('Process.exec "echo a b c d"', escape: true).should == "a b c d\n"
82+
ruby_exe('Process.exec "echo a b c d"').should == "a b c d\n"
8383
end
8484
end
8585

8686
platform_is :windows do
8787
# There is no shell expansion on Windows
8888
it "does not subject the specified command to shell expansion on Windows" do
8989
result = Dir.chdir(@dir) do
90-
ruby_exe('Process.exec "echo *"', escape: true)
90+
ruby_exe('Process.exec "echo *"')
9191
end
9292
result.should == "*\n"
9393
end
9494

9595
it "does not create an argument array with shell parsing semantics for whitespace on Windows" do
96-
ruby_exe('Process.exec "echo a b c d"', escape: true).should == "a b c d\n"
96+
ruby_exe('Process.exec "echo a b c d"').should == "a b c d\n"
9797
end
9898
end
9999

@@ -105,7 +105,7 @@
105105
platform_is :windows do
106106
cmd = '"cmd.exe", "/C", "echo", "*"'
107107
end
108-
ruby_exe("Process.exec #{cmd}", escape: true).should == "*\n"
108+
ruby_exe("Process.exec #{cmd}").should == "*\n"
109109
end
110110
end
111111

@@ -124,49 +124,49 @@
124124
end
125125

126126
it "sets environment variables in the child environment" do
127-
ruby_exe('Process.exec({"FOO" => "BAR"}, "echo ' + var + '")', escape: true).should == "BAR\n"
127+
ruby_exe('Process.exec({"FOO" => "BAR"}, "echo ' + var + '")').should == "BAR\n"
128128
end
129129

130130
it "unsets environment variables whose value is nil" do
131131
platform_is_not :windows do
132-
ruby_exe('Process.exec({"FOO" => nil}, "echo ' + var + '")', escape: true).should == "\n"
132+
ruby_exe('Process.exec({"FOO" => nil}, "echo ' + var + '")').should == "\n"
133133
end
134134
platform_is :windows do
135135
# On Windows, echo-ing a non-existent env var is treated as echo-ing any other string of text
136-
ruby_exe('Process.exec({"FOO" => nil}, "echo ' + var + '")', escape: true).should == var + "\n"
136+
ruby_exe('Process.exec({"FOO" => nil}, "echo ' + var + '")').should == var + "\n"
137137
end
138138
end
139139

140140
it "coerces environment argument using to_hash" do
141-
ruby_exe('o = Object.new; def o.to_hash; {"FOO" => "BAR"}; end; Process.exec(o, "echo ' + var + '")', escape: true).should == "BAR\n"
141+
ruby_exe('o = Object.new; def o.to_hash; {"FOO" => "BAR"}; end; Process.exec(o, "echo ' + var + '")').should == "BAR\n"
142142
end
143143

144144
it "unsets other environment variables when given a true :unsetenv_others option" do
145145
platform_is_not :windows do
146-
ruby_exe('Process.exec("echo ' + var + '", unsetenv_others: true)', escape: true).should == "\n"
146+
ruby_exe('Process.exec("echo ' + var + '", unsetenv_others: true)').should == "\n"
147147
end
148148
platform_is :windows do
149-
ruby_exe('Process.exec("' + ENV['COMSPEC'].gsub('\\', '\\\\\\') + ' /C echo ' + var + '", unsetenv_others: true)', escape: true).should == var + "\n"
149+
ruby_exe('Process.exec("' + ENV['COMSPEC'].gsub('\\', '\\\\\\') + ' /C echo ' + var + '", unsetenv_others: true)').should == var + "\n"
150150
end
151151
end
152152
end
153153

154154
describe "with a command array" do
155155
it "uses the first element as the command name and the second as the argv[0] value" do
156156
platform_is_not :windows do
157-
ruby_exe('Process.exec(["/bin/sh", "argv_zero"], "-c", "echo $0")', escape: true).should == "argv_zero\n"
157+
ruby_exe('Process.exec(["/bin/sh", "argv_zero"], "-c", "echo $0")').should == "argv_zero\n"
158158
end
159159
platform_is :windows do
160-
ruby_exe('Process.exec(["cmd.exe", "/C"], "/C", "echo", "argv_zero")', escape: true).should == "argv_zero\n"
160+
ruby_exe('Process.exec(["cmd.exe", "/C"], "/C", "echo", "argv_zero")').should == "argv_zero\n"
161161
end
162162
end
163163

164164
it "coerces the argument using to_ary" do
165165
platform_is_not :windows do
166-
ruby_exe('o = Object.new; def o.to_ary; ["/bin/sh", "argv_zero"]; end; Process.exec(o, "-c", "echo $0")', escape: true).should == "argv_zero\n"
166+
ruby_exe('o = Object.new; def o.to_ary; ["/bin/sh", "argv_zero"]; end; Process.exec(o, "-c", "echo $0")').should == "argv_zero\n"
167167
end
168168
platform_is :windows do
169-
ruby_exe('o = Object.new; def o.to_ary; ["cmd.exe", "/C"]; end; Process.exec(o, "/C", "echo", "argv_zero")', escape: true).should == "argv_zero\n"
169+
ruby_exe('o = Object.new; def o.to_ary; ["cmd.exe", "/C"]; end; Process.exec(o, "/C", "echo", "argv_zero")').should == "argv_zero\n"
170170
end
171171
end
172172

@@ -200,7 +200,7 @@
200200
end
201201
EOC
202202

203-
ruby_exe(cmd, escape: true)
203+
ruby_exe(cmd)
204204
child_fd = IO.read(@child_fd_file).to_i
205205
child_fd.to_i.should > STDERR.fileno
206206

@@ -216,7 +216,7 @@
216216
Process.exec("#{ruby_cmd(map_fd_fixture)} \#{f.fileno}", f.fileno => f.fileno)
217217
EOC
218218

219-
output = ruby_exe(cmd, escape: true)
219+
output = ruby_exe(cmd)
220220
child_fd, close_on_exec = output.split
221221

222222
child_fd.to_i.should > STDERR.fileno
@@ -232,7 +232,7 @@
232232
puts(f.close_on_exec?)
233233
EOC
234234

235-
output = ruby_exe(cmd, escape: true)
235+
output = ruby_exe(cmd)
236236
output.split.should == ['true', 'false']
237237
end
238238
end

language/alias_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def test_with_check(*args)
252252

253253
it "on top level defines the alias on Object" do
254254
# because it defines on the default definee / current module
255-
ruby_exe("def foo; end; alias bla foo; print method(:bla).owner", escape: true).should == "Object"
255+
ruby_exe("def foo; end; alias bla foo; print method(:bla).owner").should == "Object"
256256
end
257257

258258
it "raises a NameError when passed a missing name" do

0 commit comments

Comments
 (0)