From 6f5010b60961e27e5f6621c2714ce5864939daf1 Mon Sep 17 00:00:00 2001 From: dcrosby Date: Tue, 12 Nov 2024 10:39:35 -0800 Subject: [PATCH] [tests] Use rspec's ruby executable for run This fixes the assumption that `ruby` is always available from PATH. Signed-off-by: David Crosby --- spec/mixlib/shellout_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/mixlib/shellout_spec.rb b/spec/mixlib/shellout_spec.rb index e4ac5c6..fb7c062 100644 --- a/spec/mixlib/shellout_spec.rb +++ b/spec/mixlib/shellout_spec.rb @@ -18,7 +18,7 @@ let(:ruby_code) { raise "define let(:ruby_code)" } let(:options) { nil } - let(:ruby_eval) { lambda { |code| "ruby -e '#{code}'" } } + let(:ruby_eval) { lambda { |code| "#{Gem.ruby} -e '#{code}'" } } context "when instantiating" do subject { shell_cmd } @@ -1177,7 +1177,7 @@ def shell_out_cmd context "on unix", :unix_only do def ruby_wo_shell(code) - parts = %w{ruby} + parts = [ Gem.ruby ] parts << "-e" parts << code end