From cbc3a77949d54df4267c4d8bbcf12d71fbecfa1f Mon Sep 17 00:00:00 2001 From: Nan Liu Date: Wed, 15 Feb 2012 17:24:11 -0800 Subject: [PATCH] Add Puppet[:config] as a supported option. --- lib/rspec-puppet.rb | 1 + lib/rspec-puppet/example/class_example_group.rb | 1 + lib/rspec-puppet/example/define_example_group.rb | 1 + lib/rspec-puppet/example/host_example_group.rb | 1 + 4 files changed, 4 insertions(+) diff --git a/lib/rspec-puppet.rb b/lib/rspec-puppet.rb index 2d3c220..cf3a3b2 100644 --- a/lib/rspec-puppet.rb +++ b/lib/rspec-puppet.rb @@ -8,4 +8,5 @@ RSpec.configure do |c| c.add_setting :manifest_dir, :default => nil c.add_setting :manifest, :default => nil c.add_setting :template_dir, :default => nil + c.add_setting :config, :default => nil end diff --git a/lib/rspec-puppet/example/class_example_group.rb b/lib/rspec-puppet/example/class_example_group.rb index a4be515..e02d595 100644 --- a/lib/rspec-puppet/example/class_example_group.rb +++ b/lib/rspec-puppet/example/class_example_group.rb @@ -12,6 +12,7 @@ module RSpec::Puppet Puppet[:manifestdir] = self.respond_to?(:manifest_dir) ? manifest_dir : RSpec.configuration.manifest_dir Puppet[:manifest] = self.respond_to?(:manifest) ? manifest : RSpec.configuration.manifest Puppet[:templatedir] = self.respond_to?(:template_dir) ? template_dir : RSpec.configuration.template_dir + Puppet[:config] = self.respond_to?(:config) ? config : RSpec.configuration.config klass_name = self.class.top_level_description.downcase diff --git a/lib/rspec-puppet/example/define_example_group.rb b/lib/rspec-puppet/example/define_example_group.rb index ac694c7..d514cf0 100644 --- a/lib/rspec-puppet/example/define_example_group.rb +++ b/lib/rspec-puppet/example/define_example_group.rb @@ -14,6 +14,7 @@ module RSpec::Puppet Puppet[:manifestdir] = self.respond_to?(:manifest_dir) ? manifest_dir : RSpec.configuration.manifest_dir Puppet[:manifest] = self.respond_to?(:manifest) ? manifest : RSpec.configuration.manifest Puppet[:templatedir] = self.respond_to?(:template_dir) ? template_dir : RSpec.configuration.template_dir + Puppet[:config] = self.respond_to?(:config) ? config : RSpec.configuration.config # If we're testing a standalone module (i.e. one that's outside of a # puppet tree), the autoloader won't work, so we need to fudge it a bit. diff --git a/lib/rspec-puppet/example/host_example_group.rb b/lib/rspec-puppet/example/host_example_group.rb index 52fdd42..ace0491 100644 --- a/lib/rspec-puppet/example/host_example_group.rb +++ b/lib/rspec-puppet/example/host_example_group.rb @@ -12,6 +12,7 @@ module RSpec::Puppet Puppet[:manifestdir] = self.respond_to?(:manifest_dir) ? manifest_dir : RSpec.configuration.manifest_dir Puppet[:manifest] = self.respond_to?(:manifest) ? manifest : RSpec.configuration.manifest Puppet[:templatedir] = self.respond_to?(:template_dir) ? template_dir : RSpec.configuration.template_dir + Puppet[:config] = self.respond_to?(:config) ? config : RSpec.configuration.config Puppet[:code] = "" nodename = self.class.top_level_description.downcase