diff options
author | Luke Kanies <luke@madstop.com> | 2008-04-08 14:09:29 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-04-08 14:09:29 -0500 |
commit | 644d6baae132a097170631f90521e878e31a5a0a (patch) | |
tree | ad97794a1f33aa154edf0bb4453e6730c7b2a702 /spec | |
parent | 768315bd6e8ecd064ab473187c10b4633f09523c (diff) | |
download | puppet-644d6baae132a097170631f90521e878e31a5a0a.tar.gz puppet-644d6baae132a097170631f90521e878e31a5a0a.tar.xz puppet-644d6baae132a097170631f90521e878e31a5a0a.zip |
Fixing some tests that were failing because new base types
were added to Naginator, but no new related resource
types were added.
Diffstat (limited to 'spec')
-rwxr-xr-x | spec/unit/ral/type/nagios.rb | 70 |
1 files changed, 39 insertions, 31 deletions
diff --git a/spec/unit/ral/type/nagios.rb b/spec/unit/ral/type/nagios.rb index 8aca7d401..35f00b0e5 100755 --- a/spec/unit/ral/type/nagios.rb +++ b/spec/unit/ral/type/nagios.rb @@ -4,51 +4,59 @@ require File.dirname(__FILE__) + '/../../../spec_helper' require 'puppet/external/nagios' -Nagios::Base.eachtype do |name, nagios_type| - puppet_type = Puppet::Type.type("nagios_" + name.to_s) +describe "Nagios resource types" do + Nagios::Base.eachtype do |name, nagios_type| + puppet_type = Puppet::Type.type("nagios_" + name.to_s) - describe puppet_type do - it "should be defined as a Puppet resource type" do + it "should have a valid type for #{name}" do puppet_type.should_not be_nil end - it "should have documentation" do - puppet_type.instance_variable_get("@doc").should_not == "" - end + next unless puppet_type - it "should have %s as its namevar" % nagios_type.namevar do - puppet_type.namevar.should == nagios_type.namevar - end + describe puppet_type do + it "should be defined as a Puppet resource type" do + puppet_type.should_not be_nil + end - it "should have documentation for its %s parameter" % nagios_type.namevar do - puppet_type.attrclass(nagios_type.namevar).instance_variable_get("@doc").should_not be_nil - end + it "should have documentation" do + puppet_type.instance_variable_get("@doc").should_not == "" + end - it "should have an ensure property" do - puppet_type.should be_validproperty(:ensure) - end + it "should have %s as its namevar" % nagios_type.namevar do + puppet_type.namevar.should == nagios_type.namevar + end - it "should have a target property" do - puppet_type.should be_validproperty(:target) - end + it "should have documentation for its %s parameter" % nagios_type.namevar do + puppet_type.attrclass(nagios_type.namevar).instance_variable_get("@doc").should_not be_nil + end - it "should have documentation for its target property" do - puppet_type.attrclass(:target).instance_variable_get("@doc").should_not be_nil - end + it "should have an ensure property" do + puppet_type.should be_validproperty(:ensure) + end - nagios_type.parameters.reject { |param| param == nagios_type.namevar or param.to_s =~ /^[0-9]/ }.each do |param| - it "should have a %s property" % param do - puppet_type.should be_validproperty(param) + it "should have a target property" do + puppet_type.should be_validproperty(:target) end - it "should have documentation for its %s property" % param do - puppet_type.attrclass(param).instance_variable_get("@doc").should_not be_nil + it "should have documentation for its target property" do + puppet_type.attrclass(:target).instance_variable_get("@doc").should_not be_nil + end + + nagios_type.parameters.reject { |param| param == nagios_type.namevar or param.to_s =~ /^[0-9]/ }.each do |param| + it "should have a %s property" % param do + puppet_type.should be_validproperty(param) + end + + it "should have documentation for its %s property" % param do + puppet_type.attrclass(param).instance_variable_get("@doc").should_not be_nil + end end - end - nagios_type.parameters.find_all { |param| param.to_s =~ /^[0-9]/ }.each do |param| - it "should have not have a %s property" % param do - puppet_type.should_not be_validproperty(:param) + nagios_type.parameters.find_all { |param| param.to_s =~ /^[0-9]/ }.each do |param| + it "should have not have a %s property" % param do + puppet_type.should_not be_validproperty(:param) + end end end end |