1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
Description: ensure test scripts are run with the current tested interpreter
and not the default one. Useful only during transitions
Bug-Debian: https://bugs.debian.org/1019627
Author: Cédric Boutillier <boutil@debian.org>
Last-Update: 2022-12-24
Forwarded: not-needed
--- a/test/test_examples.rb
+++ b/test/test_examples.rb
@@ -106,14 +106,14 @@
def assert_output_pattern tgt_regexp, number
path = self.class.number_to_path[number]
- out, err, _ = Open3.capture3("ruby #{path}")
+ out, err, _ = Open3.capture3("#{RbConfig.ruby} #{path}")
assert_equal "", err, "no errors"
assert_match tgt_regexp, out.gsub(/\r\n/, "\n"), "output for sample#{number} should match regexp"
end
def assert_sample_file_has_no_output path
begin
- out, err, _ = Open3.capture3("ruby #{path}")
+ out, err, _ = Open3.capture3("#{RbConfig.ruby} #{path}")
assert_equal(0, out.length, "expecting empty output got [#{out}]")
assert_equal(0, err.length, "expecting empty errorput got [#{err}]")
rescue Exception => e
@@ -131,7 +131,7 @@
def run_sample(path)
run_path = File.join(OutputDir, File.basename(path))
FileUtils.cp path, run_path
- out, err, _ = Open3.capture3("ruby #{run_path}")
+ out, err, _ = Open3.capture3("#{RbConfig.ruby} #{run_path}")
return out, err
end
end
|