Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: rodjek/rspec-puppet
...
head fork: rodjek/rspec-puppet
  • 2 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
View
6 lib/rspec-puppet/example/class_example_group.rb
@@ -36,7 +36,11 @@ def catalogue
Puppet[:code] = pre_cond + "\n" + Puppet[:code]
nodename = self.respond_to?(:node) ? node : Puppet[:certname]
- facts_val = self.respond_to?(:facts) ? facts : {}
+ facts_val = {
+ 'hostname' => nodename.split('.').first,
+ 'fqdn' => nodename,
+ }
+ facts_val.merge!(munge_facts(facts)) if self.respond_to?(:facts)
build_catalog(nodename, facts_val)
end
View
2  lib/rspec-puppet/example/define_example_group.rb
@@ -42,7 +42,7 @@ def catalogue
'hostname' => nodename.split('.').first,
'fqdn' => nodename,
}
- facts_val.merge!(facts) if self.respond_to?(:facts)
+ facts_val.merge!(munge_facts(facts)) if self.respond_to?(:facts)
build_catalog(nodename, facts_val)
end
View
6 lib/rspec-puppet/support.rb
@@ -12,5 +12,11 @@ def build_catalog nodename, facts_val
Puppet::Resource::Catalog.indirection.find(node_obj.name, :use_node => node_obj)
end
end
+
+ def munge_facts(facts)
+ output = {}
+ facts.keys.each { |key| output[key.to_s] = facts[key] }
+ output
+ end
end
end
View
2  rspec-puppet.gemspec
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'rspec-puppet'
- s.version = '0.0.7'
+ s.version = '0.0.8'
s.homepage = 'https://github.com/rodjek/rspec-puppet/'
s.summary = 'RSpec tests for your Puppet manifests'
s.description = 'RSpec tests for your Puppet manifests'

No commit comments for this range

Something went wrong with that request. Please try again.