Skip to content

Commit 8010c36

Browse files
committed
[GR-17457] Check the process status and stderr before other expectations.
PullRequest: truffleruby/1997
2 parents a23c3d9 + 4514003 commit 8010c36

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

spec/truffle/launcher_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ def check_status_or_print(stdout_and_stderr)
7272
unless [:ruby, :truffleruby].include?(launcher)
7373
it "runs #{launcher} as an -S command" do
7474
out = ruby_exe(nil, options: "-S#{launcher} --version", args: @redirect)
75-
out.should =~ test
7675
check_status_and_empty_stderr
76+
out.should =~ test
7777
end
7878
end
7979
end
@@ -82,8 +82,8 @@ def check_status_or_print(stdout_and_stderr)
8282
it "supports running #{launcher} in any of the bin/ directories" do
8383
@bin_dirs.each do |bin_dir|
8484
out = `#{bin_dir}/#{launcher} --version #{@redirect}`
85-
out.should =~ test
8685
check_status_and_empty_stderr
86+
out.should =~ test
8787
end
8888
end
8989
end
@@ -98,8 +98,8 @@ def check_status_or_print(stdout_and_stderr)
9898
linkname = "linkto#{launcher}"
9999
File.symlink("#{bin_dir}/#{launcher}", linkname)
100100
out = `./#{linkname} --version #{@redirect}`
101-
out.should =~ test
102101
check_status_and_empty_stderr
102+
out.should =~ test
103103
end
104104
end
105105
end
@@ -148,17 +148,17 @@ def check_status_or_print(stdout_and_stderr)
148148
['RUBYOPT', 'TRUFFLERUBYOPT'].each do |var|
149149
it "should recognize ruby --vm options in #{var}" do
150150
out = ruby_exe('print Truffle::System.get_java_property("foo")', env: { var => "--vm.Dfoo=bar" }, args: @redirect)
151-
out.should == 'bar'
152151
check_status_and_empty_stderr
152+
out.should == 'bar'
153153
end
154154
end
155155

156156
def should_print_full_java_command(options, env: {})
157157
out = ruby_exe(nil, options: options, env: env, args: @redirect)
158+
check_status_and_empty_stderr
158159
parts = out.split(' ')
159160
parts[0].should == "$"
160161
parts[1].should =~ /(java|graalvm)$/
161-
check_status_and_empty_stderr
162162
end
163163

164164
it "does not create context on --version and -v" do

0 commit comments

Comments
 (0)