Skip to content

Commit 28a414a

Browse files
odaysecrafaelfranca
authored andcommitted
Update basic.rb
1 parent 3178667 commit 28a414a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lib/thor/shell/basic.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ def merge(destination, content) #:nodoc:
372372
Tempfile.open([File.basename(destination), File.extname(destination)], File.dirname(destination)) do |temp|
373373
temp.write content
374374
temp.rewind
375-
system %(#{merge_tool} "#{temp.path}" "#{destination}")
375+
system(merge_tool, temp.path, destination)
376376
end
377377
end
378378

spec/actions/create_file_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def silence!
142142
create_file("doc/config.rb")
143143
allow(@base.shell).to receive(:merge_tool).and_return("meld")
144144
expect(Thor::LineEditor).to receive(:readline).and_return("m")
145-
expect(@base.shell).to receive(:system).with(/meld/)
145+
expect(@base.shell).to receive(:system).with("meld", /doc\/config\.rb/, /doc\/config\.rb/)
146146
invoke!
147147
end
148148
end

spec/shell/basic_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,14 +553,14 @@ def #456 Lanç...
553553
it "invokes the merge tool" do
554554
allow(shell).to receive(:merge_tool).and_return("meld")
555555
expect(Thor::LineEditor).to receive(:readline).and_return("m")
556-
expect(shell).to receive(:system).with(/meld/)
556+
expect(shell).to receive(:system).with("meld", /foo/, "foo")
557557
capture(:stdout) { shell.file_collision("foo") {} }
558558
end
559559

560560
it "invokes the merge tool that specified at ENV['THOR_MERGE']" do
561561
allow(ENV).to receive(:[]).with("THOR_MERGE").and_return("meld")
562562
expect(Thor::LineEditor).to receive(:readline).and_return("m")
563-
expect(shell).to receive(:system).with(/meld/)
563+
expect(shell).to receive(:system).with("meld", /foo/, "foo")
564564
capture(:stdout) { shell.file_collision("foo") {} }
565565
end
566566

0 commit comments

Comments
 (0)