RSpec tests failing after upgrading to rspec-puppet v1.0.1

174 views
Skip to first unread message

Gavin Williams

unread,
Dec 6, 2013, 4:51:54 AM12/6/13
to puppet...@googlegroups.com
Morning all

Not sure if anybody on here is going to be able to assist, but thought I'd ask anyways...

I've upgraded rspec-puppet to v1.0.1 this morning, and now all my rspec tests are failing with:

Failure/Error: it { should_not contain_class('software::hp::psp') }
     Puppet::Error:
       Puppet::Parser::AST::Resource failed with error TypeError: can't convert Hash into String at /etc/puppet/environments/common/act/spec/fixtures/modules/act/manifests/software/linux/puppet_agent.pp:27 on node puppet-dev.card.co.uk

 The failure point quoted isn't doing anything special. The code is here[1], and is failing at line 27.

Running with backtrace, do get a fairly long trace, that seems to start in hiera code... [2]

However that has been working fine prior to upgrading rspec-puppet.
With regards to framework, I'm using puppetlabs-spec-helper, rspec-puppet and hiera-puppet-helper.

I've got a hiera_config defined as a shared_context [3], so I'm wondering if the new hiera support in rspec-puppet is clashing with hiera-puppet-helper :s

Any ideas appreciated. As there are some cool new features in rspec-puppet that I'd like to use, but can't have all my tests breaking...

Cheers
Gavin

[1] https://gist.github.com/fatmcgav/7821149#file-software_linux_puppet_agent-pp
[2] https://gist.github.com/fatmcgav/7821149#file-failure-trace-log
[3] https://gist.github.com/fatmcgav/7821149#file-hiera-rb

Gavin Williams

unread,
Dec 6, 2013, 6:12:52 AM12/6/13
to puppet...@googlegroups.com
Ok, after raising on issue against rspec-puppet on Github, Tim responded with some more information... [1]

Long and short is now that rspec-puppet supports Hiera, there's no need to use hiera-puppet-helper or rspec-hiera-helper... Can set it all up from within rspec...

Sample code from Tim and myself available on the aforementioned link...

Cheers
Gavin

[1] https://github.com/rodjek/rspec-puppet/issues/131
Reply all
Reply to author
Forward
0 new messages