mirror of
https://github.com/donl/homebrew-cask-versions.git
synced 2026-07-17 06:16:47 -06:00
42 lines
1.1 KiB
Ruby
42 lines
1.1 KiB
Ruby
require 'test_helper'
|
|
|
|
describe Cask::CLI do
|
|
it "supports setting the appdir" do
|
|
Cask::CLI.process_options %w{help --appdir=/some/path/foo}
|
|
|
|
Cask.appdir.must_equal Pathname('/some/path/foo')
|
|
end
|
|
|
|
it "supports setting the appdir from ENV" do
|
|
ENV['HOMEBREW_CASK_OPTS'] = "--appdir=/some/path/bar"
|
|
|
|
Cask::CLI.process_options %w{help}
|
|
|
|
Cask.appdir.must_equal Pathname('/some/path/bar')
|
|
end
|
|
|
|
it "supports setting the prefpanedir" do
|
|
Cask::CLI.process_options %w{help --prefpanedir=/some/path/foo}
|
|
|
|
Cask.prefpanedir.must_equal Pathname('/some/path/foo')
|
|
end
|
|
|
|
it "supports setting the prefpanedir from ENV" do
|
|
ENV['HOMEBREW_CASK_OPTS'] = "--prefpanedir=/some/path/bar"
|
|
|
|
Cask::CLI.process_options %w{help}
|
|
|
|
Cask.prefpanedir.must_equal Pathname('/some/path/bar')
|
|
end
|
|
|
|
it "allows additional options to be passed through" do
|
|
rest = Cask::CLI.process_options %w{edit foo --create --appdir=/some/path/qux}
|
|
|
|
Cask.appdir.must_equal Pathname('/some/path/qux')
|
|
rest.must_equal %w{edit foo --create}
|
|
end
|
|
|
|
after do
|
|
ENV['HOMEBREW_CASK_OPTS'] = nil
|
|
end
|
|
end
|