mirror of
https://github.com/donl/homebrew-cask-versions.git
synced 2026-07-17 14:26:45 -06:00
* "Canonical App Name" becomes "Simplified App Name"
* devscript `cask_namer` renamed to `generate_cask_token`
* doc file `CASK_NAMING_REFERENCE.md` renamed to `cask_token_reference.md`
* DSL uses `"#{token}"` for interpolation instead of `"#{title}"`
* documentation text
* backend code (variables, method, class names)
* error message text
* tests
* code comments
* Cask comments
* emphasize `tags :name`
* doc: use "vendor" consistently instead of "developer"
* doc: many man page argument descriptions were incorrect
* incidental clarifications
Many backend variables similar to `cask_name` or `cask` have
been standardized to `cask_token`, `token`, etc, resolving a long-
standing ambiguity in which variables named `cask` might contain
a Cask instance or a string token.
In many places the docs could be shortened from "Cask name" to
simply "token", which is desirable because we use the term "Cask"
in too many contexts.
45 lines
1.1 KiB
Ruby
45 lines
1.1 KiB
Ruby
require 'test_helper'
|
|
|
|
describe Cask::CLI::Audit do
|
|
let(:auditor) { mock() }
|
|
let(:cask) { mock() }
|
|
|
|
describe 'selection of Casks to audit' do
|
|
it 'audits all Casks if no tokens are given' do
|
|
Cask.stubs(:all => [cask, cask])
|
|
auditor.expects(:audit).times(2)
|
|
|
|
run_audit([], auditor)
|
|
end
|
|
|
|
it 'audits specified Casks if tokens are given' do
|
|
cask_token = 'nice-app'
|
|
Cask.expects(:load).with(cask_token).returns(cask)
|
|
auditor.expects(:audit).with(cask, :audit_download => false)
|
|
|
|
run_audit([cask_token], auditor)
|
|
end
|
|
end
|
|
|
|
describe 'rules for downloading a Cask' do
|
|
it 'does not download the Cask per default' do
|
|
Cask.stubs(:load => cask)
|
|
|
|
auditor.expects(:audit).with(cask, :audit_download => false)
|
|
|
|
run_audit(['casktoken'], auditor)
|
|
end
|
|
|
|
it 'download a Cask if --download flag is set' do
|
|
Cask.stubs(:load => cask)
|
|
|
|
auditor.expects(:audit).with(cask, :audit_download => true)
|
|
|
|
run_audit(['casktoken', '--download'], auditor)
|
|
end
|
|
end
|
|
|
|
def run_audit(args, auditor)
|
|
Cask::CLI::Audit.new(args, auditor).run
|
|
end
|
|
end
|