Skip to content

Commit

Permalink
[tests] Use rspec's ruby executable for run
Browse files Browse the repository at this point in the history
This fixes the assumption that `ruby` is always available from PATH.

Signed-off-by: David Crosby <[email protected]>
  • Loading branch information
dafyddcrosby committed Nov 12, 2024
1 parent 01d9984 commit 6f5010b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/mixlib/shellout_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6f5010b

Please sign in to comment.