Skip to content
Snippets Groups Projects
Commit 4dd9a5c4 authored by Corey Osman's avatar Corey Osman
Browse files

Add object templates for generating new facts

  * previously pdk did not support creating facts.  Now that
    it does we need the proper object templates to support generating
    facts and fact test files.
parent e470d97b
Branches
Tags
No related merge requests found
Facter.add(:<%= name %>) do
# https://puppet.com/docs/puppet/6.19/fact_overview.html
setcode do
'hello facter'
end
end
require 'spec_helper'
require 'facter'
require 'facter/<%= name %>'
describe :'<%= name %>', type: :fact do
subject(:fact) { Facter.fact(:'<%= name %>') }
before :all do
# perform any action that should be run for the entire test suite
end
before :each do
# perform any action that should be run before every test
Facter.clear
end
it 'should return a value' do
expect(fact.value).to eq('hello facter')
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment