Skip to content

Commit

Permalink
Add custom facts
Browse files Browse the repository at this point in the history
This uses the rspec-puppet-facts 1.7 feature to add custom facts. Since
we often override this in our specs this can greatly reduce duplication
in our specs.
  • Loading branch information
ekohl committed Oct 23, 2016
1 parent 976c82d commit 1338a46
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config_defaults.yml
Expand Up @@ -7,7 +7,7 @@ Gemfile:
- gem: rspec-puppet
version: '~> 2.3'
- gem: rspec-puppet-facts
version: '>= 1.5'
version: '>= 1.7'
- gem: puppetlabs_spec_helper
version: '>= 0.8.0'
- gem: puppet-lint
Expand Down
4 changes: 4 additions & 0 deletions moduleroot/spec/spec_helper.rb
Expand Up @@ -9,6 +9,10 @@
require 'rspec-puppet-facts'
include RspecPuppetFacts
# Original fact sources:
add_custom_fact :concat_basedir, '/tmp' # puppetlabs-concat
add_custom_fact :puppetversion, Puppet.version # Facter, but excluded from rspec-puppet-facts
# Workaround for no method in rspec-puppet to pass undef through :params
class Undef
def inspect; 'undef'; end
Expand Down

0 comments on commit 1338a46

Please sign in to comment.