Hi Steve,

I can reproduce this locally, and it looks like some kind of setup issue 
around how (rspec-)puppet is loading lookup data.

I'll look into it, and keep you posted.

Regards, David

On Monday, October 31, 2016 at 2:39:54 AM UTC, Stephen Nesbitt wrote:
>
> 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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/7188ddc7-c652-43b7-800a-1b5ee4f32376%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to