Browse Source
Options can be passed on the command-line and/or using the HOMEBREW_CASK_OPTS environment variable (which has lowest priority). There is a single --appdir=PATH option right now, but this commit enables future awesomeness! Other minor changes: * `brew cask help` now returns the same thing as `brew cask` instead of saying there was “no such command as help”. * The HEREDOC block now uses Homebrew's #undent instead of the customed-rolled #gsub version. Cleaner and more flexible. * `Cask.set_appdir` has been renamed to `Cask.appdir=`. This is more Rubyish, and of little consequence (the only place it was previously used was in the tests).
Félix Saparelli
12 years ago
5 changed files with 61 additions and 5 deletions
@ -0,0 +1,26 @@ |
|||||
|
require 'test_helper' |
||||
|
|
||||
|
describe Cask::CLI do |
||||
|
it "supports setting the appdir" do |
||||
|
shutup do |
||||
|
Cask::CLI.process %w{help --appdir=/some/path} |
||||
|
end |
||||
|
|
||||
|
Cask.appdir.must_equal Pathname.new File.expand_path "/some/path" |
||||
|
end |
||||
|
|
||||
|
it "supports setting the appdir from ENV" do |
||||
|
ENV['HOMEBREW_CASK_OPTS'] = "--appdir=/some/path" |
||||
|
|
||||
|
shutup do |
||||
|
Cask::CLI.process %w{help} |
||||
|
end |
||||
|
|
||||
|
Cask.appdir.must_equal Pathname.new File.expand_path "/some/path" |
||||
|
end |
||||
|
|
||||
|
after do |
||||
|
ENV['HOMEBREW_CASK_OPTS'] = nil |
||||
|
Cask.appdir = CANNED_APPDIR |
||||
|
end |
||||
|
end |
Loading…
Reference in new issue