Skip to content

Commit c1923fa

Browse files
committed
Fix launcher spec for -v and --version to not depend on timings
1 parent 5975d2a commit c1923fa

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

spec/truffle/launcher_spec.rb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,15 @@ def should_print_full_java_command(options, env: {})
8181
end
8282

8383
it "does not create context on --version and -v" do
84-
short = Benchmark.realtime { ruby_exe(nil, options: "--help:languages") }
85-
version = Benchmark.realtime { ruby_exe(nil, options: "--version") }
86-
v = Benchmark.realtime { ruby_exe(nil, options: "-v") }
87-
88-
version.should <= short + 0.5
89-
v.should <= short + 0.5
84+
v = ruby_exe(nil, options: "-Xlog=FINE -v", args: "2>&1")
85+
v.should_not include("createContext()")
86+
v.should_not include("patchContext()")
87+
v.should include("truffleruby ")
88+
89+
version = ruby_exe(nil, options: "-Xlog=FINE --version", args: "2>&1")
90+
version.should_not include("createContext()")
91+
version.should_not include("patchContext()")
92+
version.should include("truffleruby ")
9093
end
9194

9295
it "preserve spaces in options" do

0 commit comments

Comments
 (0)