All:

I'm struggling to unit test a very simple profile with a dependency on the 
ntp 5.0.0 module - the ntp version implementing module data. The problem is 
that none of the default values for ntp are visible/available to the unit 
test as indicated by the failure:
  1) profile::ntp::client with default values for all parameters 
profile::ntp::client should compile into a catalogue without dependency 
cycles
     Failure/Error: it { is_expected.to compile.with_all_deps }
     
      error during compilation: Evaluation Error: Error while evaluating a 
Function Call, Class[Ntp]:
         expects a value for parameter 'autoupdate'
         expects a value for parameter 'broadcastclient'
         expects a value for parameter 'config'
         ...


The profile::ntp::client class is very simple:

class profile::ntp::client {
 include ::ntp
}

My spec helper is:

require 'puppetlabs_spec_helper/module_spec_helper'

RSpec.configure do |c|
 c.after(:suite) do
 RSpec::Puppet::Coverage.report!(95)
 end
end

My .fixtures.yml


fixtures:
 forge_modules:
 ntp: 'puppetlabs/ntp'
 stdlib: 'puppetlabs/stdlib'
 symlinks:
 profile: "#{source_dir}/../profile"


My unit test:

require 'spec_helper'

describe 'profile::ntp::client' do
  context 'with default values for all parameters' do
    describe 'profile::ntp::client' do
      it { is_expected.to compile.with_all_deps }
      # it { is_expected.to contain_class('profile::ntp::client') }
      # it { is_expected.to contain_class('::ntp') }

      end
  end
end


Puppet version is 4.7.0. Host OS is ubuntu 16.04


Any help in resolving this would be much appreciated.


-steve

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/3440ce9a-84fe-4240-a3e1-8358c39674a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to