-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from RoboticCheese/jdh-update-provider-resolver…
…-style Update provider resolver style
- Loading branch information
Showing
21 changed files
with
144 additions
and
145 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
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
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 was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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,40 @@ | ||
# Encoding: UTF-8 | ||
|
||
require_relative '../spec_helper' | ||
require_relative '../../libraries/provider_gimp_app_suse' | ||
|
||
describe Chef::Provider::GimpApp::Suse do | ||
let(:name) { 'default' } | ||
let(:new_resource) { Chef::Resource::GimpApp.new(name, nil) } | ||
let(:provider) { described_class.new(new_resource, nil) } | ||
|
||
describe '.provides?' do | ||
let(:platform) { nil } | ||
let(:node) { ChefSpec::Macros.stub_node('node.example', platform) } | ||
let(:res) { described_class.provides?(node, new_resource) } | ||
|
||
{ | ||
'OpenSUSE' => { platform: 'opensuse', version: '13.1' }, | ||
'SUSE' => { platform: 'suse', version: '12.0' } | ||
}.each do |k, v| | ||
context k do | ||
let(:platform) { v } | ||
|
||
it 'returns true' do | ||
expect(res).to eq(true) | ||
end | ||
end | ||
end | ||
end | ||
|
||
describe '#install!' do | ||
it 'uses a package to install GIMP' do | ||
p = provider | ||
expect(p).to receive(:include_recipe).with('zypper') | ||
expect(p).to receive(:package).with('gimp').and_yield | ||
expect(p).to receive(:version).with(nil) | ||
expect(p).to receive(:action).with(:install) | ||
p.send(:install!) | ||
end | ||
end | ||
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
Oops, something went wrong.