From f7418232b167cbb5c8071b7d0491aef82948feff Mon Sep 17 00:00:00 2001 From: Zeroday BYTE <47859767+odaysec@users.noreply.github.com> Date: Fri, 28 Feb 2025 09:22:03 +0700 Subject: [PATCH] Update basic.rb --- lib/thor/shell/basic.rb | 2 +- spec/actions/create_file_spec.rb | 2 +- spec/shell/basic_spec.rb | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/thor/shell/basic.rb b/lib/thor/shell/basic.rb index 71ce4071..1cccca72 100644 --- a/lib/thor/shell/basic.rb +++ b/lib/thor/shell/basic.rb @@ -372,7 +372,7 @@ def merge(destination, content) #:nodoc: Tempfile.open([File.basename(destination), File.extname(destination)], File.dirname(destination)) do |temp| temp.write content temp.rewind - system %(#{merge_tool} "#{temp.path}" "#{destination}") + system(merge_tool, temp.path, destination) end end diff --git a/spec/actions/create_file_spec.rb b/spec/actions/create_file_spec.rb index 963814e1..45ac3c05 100644 --- a/spec/actions/create_file_spec.rb +++ b/spec/actions/create_file_spec.rb @@ -142,7 +142,7 @@ def silence! create_file("doc/config.rb") allow(@base.shell).to receive(:merge_tool).and_return("meld") expect(Thor::LineEditor).to receive(:readline).and_return("m") - expect(@base.shell).to receive(:system).with(/meld/) + expect(@base.shell).to receive(:system).with("meld", /doc\/config\.rb/, /doc\/config\.rb/) invoke! end end diff --git a/spec/shell/basic_spec.rb b/spec/shell/basic_spec.rb index 37fae04a..659afd2e 100644 --- a/spec/shell/basic_spec.rb +++ b/spec/shell/basic_spec.rb @@ -553,14 +553,14 @@ def #456 Lanç... it "invokes the merge tool" do allow(shell).to receive(:merge_tool).and_return("meld") expect(Thor::LineEditor).to receive(:readline).and_return("m") - expect(shell).to receive(:system).with(/meld/) + expect(shell).to receive(:system).with("meld", /foo/, "foo") capture(:stdout) { shell.file_collision("foo") {} } end it "invokes the merge tool that specified at ENV['THOR_MERGE']" do allow(ENV).to receive(:[]).with("THOR_MERGE").and_return("meld") expect(Thor::LineEditor).to receive(:readline).and_return("m") - expect(shell).to receive(:system).with(/meld/) + expect(shell).to receive(:system).with("meld", /foo/, "foo") capture(:stdout) { shell.file_collision("foo") {} } end