From: Nilesh Patra <nilesh@debian.org>
Date: Fri, 27 Dec 2024 16:15:01 -0300
Subject: Run tests with right ruby version rather than /usr/bin/ruby

Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1019666
Forwarded: NO
Last-Update: 2022-12-22
---
 spec/coverage_for_eval_spec.rb | 2 +-
 spec/return_codes_spec.rb      | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/spec/coverage_for_eval_spec.rb b/spec/coverage_for_eval_spec.rb
index 7677b3a..b38b9fb 100644
--- a/spec/coverage_for_eval_spec.rb
+++ b/spec/coverage_for_eval_spec.rb
@@ -16,7 +16,7 @@ RSpec.describe "coverage for eval" do
     end
 
     context "foo" do
-      let(:command) { "ruby eval_test.rb" }
+      let(:command) { "#{RbConfig.ruby} eval_test.rb" }
 
       it "records coverage for erb" do
         expect(@stdout).to include(" 2 / 3 LOC")
diff --git a/spec/return_codes_spec.rb b/spec/return_codes_spec.rb
index e3656b3..f2e71f1 100644
--- a/spec/return_codes_spec.rb
+++ b/spec/return_codes_spec.rb
@@ -52,7 +52,7 @@ describe "return codes" do
     end
 
     context "when running testunit_good.rb" do
-      let(:command) { "ruby testunit_good.rb" }
+      let(:command) { "#{RbConfig.ruby} testunit_good.rb" }
       it_behaves_like "good tests"
     end
 
@@ -62,7 +62,7 @@ describe "return codes" do
     end
 
     context "when running testunit_bad.rb" do
-      let(:command) { "ruby testunit_bad.rb" }
+      let(:command) { "#{RbConfig.ruby} testunit_bad.rb" }
       it_behaves_like "bad tests"
     end
 
