From f174b1c29c89c38ed8284077e712e87e36eea470 Mon Sep 17 00:00:00 2001 From: "Kevin R. Barnes" Date: Wed, 19 Dec 2007 06:13:32 -0600 Subject: [PATCH] pairing with luke, nagios_command provider skeleton --- lib/puppet/provider/nagios_command/naginator.rb | 5 ++++ spec/unit/ral/provider/nagios_command/naginator.rb | 35 ++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 lib/puppet/provider/nagios_command/naginator.rb create mode 100644 spec/unit/ral/provider/nagios_command/naginator.rb diff --git a/lib/puppet/provider/nagios_command/naginator.rb b/lib/puppet/provider/nagios_command/naginator.rb new file mode 100644 index 00000000..dc627ef2 --- /dev/null +++ b/lib/puppet/provider/nagios_command/naginator.rb @@ -0,0 +1,5 @@ +require 'puppet/provider/parsedfile' + +Puppet::Type.type(:nagios_command).provide(:naginator, :parent => Puppet::Provider::ParsedFile, :default_target => '/etc/nagios/nagios_command.cfg') do + +end diff --git a/spec/unit/ral/provider/nagios_command/naginator.rb b/spec/unit/ral/provider/nagios_command/naginator.rb new file mode 100644 index 00000000..097ee09b --- /dev/null +++ b/spec/unit/ral/provider/nagios_command/naginator.rb @@ -0,0 +1,35 @@ +require File.dirname(__FILE__) + '/../../../../spec_helper' +require 'puppet/provider/nagios_command/naginator' + +describe Puppet::Type.type(:nagios_command).provider(:naginator) do + before do + @provider_class = Puppet::Type.type(:nagios_command).provider(:naginator) + end + + it 'should have a default target' do + @provider_class.default_target.should == '/etc/nagios/nagios_command.cfg' + end + + it 'should add provider instances to target file whose ensure value is present' + + it 'should remove provider instances to target file whose ensure value is absent' + + it 'should do nothing to provider instances that are and should be present' + + it 'should ignore provider instances that are and should be absent' + + it 'should move provider instances from one file to another if the current value is different from the desired value' + + + it 'should change attrs of provider instances on file to match desired values' + + it 'should add specified attrs of provider instances to file when missing from file' + + it 'should remove unspecified attrs of provider instances from file' + + it 'should be able to return a list of all provider instances from the default target' + + it 'should prefetch attr values from all targets of all given resources' + + it 'should have a toplevel hook that writes all providers to disk' +end -- 2.11.4.GIT