-
-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement self.prefetch for zabbix_proxy
This is another change for #570.
- Loading branch information
Showing
6 changed files
with
97 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require 'spec_helper' | ||
|
||
describe Puppet::Type.type(:zabbix_proxy).provider(:ruby) do | ||
let(:resource) do | ||
Puppet::Type.type(:zabbix_proxy).new( | ||
name: 'Testproxy' | ||
) | ||
end | ||
let(:provider) { resource.provider } | ||
|
||
it 'be an instance of the correct provider' do | ||
expect(provider).to be_an_instance_of Puppet::Type::Zabbix_proxy::ProviderRuby | ||
end | ||
|
||
[:instances, :prefetch].each do |method| | ||
it "should respond to the class method #{method}" do | ||
expect(described_class).to respond_to(method) | ||
end | ||
end | ||
|
||
[:create, :exists?].each do |method| | ||
it "should respond to the instance method #{method}" do | ||
expect(described_class.new).to respond_to(method) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
require 'spec_helper' | ||
|
||
describe Puppet::Type.type(:zabbix_proxy) do | ||
describe 'when validating params' do | ||
[ | ||
:hostname, | ||
:provider | ||
].each do |param| | ||
it "should have a #{param} parameter" do | ||
expect(described_class.attrtype(param)).to eq(:param) | ||
end | ||
end | ||
end | ||
|
||
describe 'when validating properties' do | ||
[ | ||
:ipaddress, | ||
:use_ip, | ||
:mode, | ||
:port | ||
].each do |param| | ||
it "should have a #{param} property" do | ||
expect(described_class.attrtype(param)).to eq(:property) | ||
end | ||
end | ||
end | ||
|
||
describe 'namevar' do | ||
it 'has :hostname as its namevar' do | ||
expect(described_class.key_attributes).to eq([:hostname]) | ||
end | ||
end | ||
end |