This repository has been archived by the owner on Dec 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Add brew-boxen-cask-install #57
Open
n0ts
wants to merge
14
commits into
boxen:master
Choose a base branch
from
n0ts:topic-brewcask
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ac7fec7
Add brew-boxen-cask-install
n0ts a7e1432
Add class comment
n0ts 83593ec
Merge branch 'master' into topic-brewcask
n0ts db7ae4c
Merge branch 'master' into topic-brewcask
n0ts fb0828c
Fix feedback
n0ts bd4c3d2
Update README
n0ts b199806
Add provider test
n0ts 039c8bc
Changed test cask name
n0ts 2d011bc
CI os change to osx
n0ts 3ab67cd
Remove OS
jacobbednarz c549f1c
Fix tests
n0ts 58a491c
Update Gemfile.lock
n0ts f3a0cd8
Update cardboard
n0ts 903a127
Add tap caskroom/cask
n0ts File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,4 @@ | ||
$LOAD_PATH.unshift("#{HOMEBREW_LIBRARY_PATH}/cask/lib") | ||
require "hbc" | ||
|
||
Hbc::CLI::Install.new(ARGV).run |
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
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
require "rspec-puppet" | ||
require 'rspec-puppet' | ||
|
||
fixture_path = File.expand_path File.join(__FILE__, "..", "fixtures") | ||
fixture_path = File.expand_path File.join(__FILE__, '..', 'fixtures') | ||
|
||
RSpec.configure do |c| | ||
c.manifest_dir = File.join(fixture_path, "manifests") | ||
c.module_path = File.join(fixture_path, "modules") | ||
c.manifest_dir = File.join(fixture_path, 'manifests') | ||
c.module_path = File.join(fixture_path, 'modules') | ||
end | ||
|
||
def default_test_facts | ||
{ | ||
:boxen_home => "/test/boxen", | ||
:boxen_srcdir => "/test/boxen/src", | ||
:boxen_user => "testuser", | ||
:boxen_home => '/test/boxen', | ||
:boxen_srcdir => '/test/boxen/src', | ||
:boxen_user => 'testuser', | ||
} | ||
end |
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,76 @@ | ||
require 'spec_helper' | ||
|
||
provider = Puppet::Type.type(:package).provider(:brewcask) | ||
|
||
describe provider do | ||
it 'should have an install method' do | ||
is_expected.to respond_to(:install) | ||
end | ||
|
||
it 'should have a uninstall method' do | ||
is_expected.to respond_to(:uninstall) | ||
end | ||
|
||
it 'should not have a latst method' do | ||
is_expected.not_to respond_to(:latest) | ||
end | ||
|
||
it 'should not have a update method' do | ||
is_expected.not_to respond_to(:update) | ||
end | ||
|
||
describe 'when installing' do | ||
context 'installing cask without install options' do | ||
before do | ||
@resource = Puppet::Type.type(:package).new( | ||
:name => 'mycask', | ||
:ensure => :present, | ||
:provider => :brewcask, | ||
) | ||
@provider = provider.new(@resource) | ||
end | ||
|
||
it 'should return install command' do | ||
expect{ @provider.install }.to raise_error(Puppet::ExecutionFailure, | ||
/brew boxen-cask-install mycask/) | ||
end | ||
|
||
it 'should return nil query' do | ||
expect(@provider.query).to eq(nil) | ||
end | ||
end | ||
|
||
context 'installing cask with install options' do | ||
before do | ||
@resource = Puppet::Type.type(:package).new( | ||
:name => 'mycask', | ||
:ensure => :present, | ||
:provider => :brewcask, | ||
:install_options => '--foo', | ||
) | ||
@provider = provider.new(@resource) | ||
end | ||
|
||
it 'should return install command with install options' do | ||
expect { @provider.install }.to raise_error(Puppet::ExecutionFailure, | ||
/brew cask install --foo mycask/) | ||
end | ||
end | ||
end | ||
|
||
describe 'when uninstalling' do | ||
before do | ||
@resource = Puppet::Type.type(:package).new( | ||
:name => 'mycask', | ||
:ensure => :present, | ||
:provider => :brewcask, | ||
) | ||
@provider = provider.new(@resource) | ||
end | ||
|
||
it 'should return uninstall command' do | ||
expect { @provider.uninstall }.to raise_error(Puppet::ExecutionFailure, | ||
/brew cask uninstall --force mycask/) | ||
end | ||
end | ||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was only looking at why Canary wasn't installing for me last week and completely overlooked this.