-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add --install-actions and --install-prefix
These flags are used when --install is given. --install-actions is boolean and determines whether or not to run the installation actions (notify launchd, etc). --install-prefix is a string letting you tell pleaserun where to write files to. This is intended to help packagers. This should satisfy #43
- Loading branch information
1 parent
2773b82
commit cba0c1d
Showing
2 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
require "pleaserun/cli" | ||
|
||
describe PleaseRun::CLI do | ||
subject { PleaseRun::CLI.new("pleaserun") } | ||
|
||
context "when setting --install-prefix" do | ||
let(:output) { Stud::Temporary.directory } | ||
let(:name) { rand(10).times.collect { (rand(26) + 97).chr }.join } | ||
let(:args) { [ "--install", "--install-prefix", output, "--no-install-actions", "-p", "sysv", "-v", "lsb-3.1", "--name", name, "/some/example" ] } | ||
|
||
before do | ||
subject.run(args) | ||
end | ||
after do | ||
FileUtils.rm_r(output) if File.directory?(output) | ||
end | ||
it "should write files there" do | ||
[ "/etc", "/etc/init.d", "/etc/init.d/#{name}" ].each do |path| | ||
expect(File).to be_exists(File.join(output, path)) | ||
end | ||
end | ||
end | ||
end |