2017-02-23 06:02:51 +01:00
|
|
|
describe "brew custom-external-command", :integration_test do
|
|
|
|
it "is supported" do
|
2017-02-28 14:50:46 +01:00
|
|
|
mktmpdir do |path|
|
2017-02-23 06:02:51 +01:00
|
|
|
cmd = "custom-external-command-#{rand}"
|
|
|
|
file = path/"brew-#{cmd}"
|
|
|
|
|
2017-10-15 02:28:32 +02:00
|
|
|
file.write <<~EOS
|
2017-02-23 06:02:51 +01:00
|
|
|
#!/bin/sh
|
|
|
|
echo 'I am #{cmd}.'
|
|
|
|
EOS
|
|
|
|
FileUtils.chmod "+x", file
|
|
|
|
|
|
|
|
expect { brew cmd, "PATH" => "#{path}#{File::PATH_SEPARATOR}#{ENV["PATH"]}" }
|
|
|
|
.to output("I am #{cmd}.\n").to_stdout
|
|
|
|
.and not_to_output.to_stderr
|
|
|
|
.and be_a_success
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|