Issue with rspec-puppet testing of roles/profiles module and class evaluation...

334 views
Skip to first unread message

Gavin Williams

unread,
Sep 25, 2014, 9:42:26 AM9/25/14
to puppet...@googlegroups.com
Afternoon all

I'm currently trying to add some rspec testing to some of our internal modules which are used in a roles/profiles style setup.

Each of our products has got it's own module, which all pull in chunks of functionality from a base module.

The issue I'm hitting is that when I try and spec test the product module, which attempts to use Glassfish module resources[1], with the base Glassfish class being included as part of a 'base::software::glassfish' class.
I've tried adding a 'require base::software::glassfish' as a precondition to rspec, but still get failures...

In order to make sure I wasn't doing anything daft, I've created a pair of very simple modules that are available on Github that model the product and base classes I'm trying to test.
The modules are: rspec-deptest[2], which is effectively our product module, and rspec-deptest_base[3] which is our base module.

The error I'm getting when trying to run bundle exec rake spec on the rspec-deptest module is here[4]. I'm also getting this error on travis[5].

Any pointers on what I could be doing wrong, or how I can make it work?

Cheers in advance for any responses.

Regards
Gavin

[1] https://github.com/fatmcgav/fatmcgav-glassfish/tree/develop
[2] https://github.com/fatmcgav/rspec-deptest/tree/use-deptest_profiles
[3] https://github.com/fatmcgav/rspec-deptest_base
[4] https://gist.github.com/fatmcgav/b849b073f04ab592ed45
[5] https://travis-ci.org/fatmcgav/rspec-deptest/jobs/36255663

Gavin Williams

unread,
Sep 25, 2014, 10:12:20 AM9/25/14
to puppet...@googlegroups.com
Note to self, need to do better at reading the manual :(

The issue was a typo - It should be 'pre_condition', not 'precondition' - https://github.com/fatmcgav/rspec-deptest/commit/6a4f5a5294d7bb239b8f98cabe6c32e3522569de

Tests now working...

Cheers
Gav
Reply all
Reply to author
Forward
0 new messages