Add Puppet[:config] as a supported option.

This commit is contained in:
Nan Liu 2012-02-15 17:24:11 -08:00
parent a1b5ebe25d
commit cbc3a77949
4 changed files with 4 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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