rspec-puppet error during compilation: Invalid tag '::file'

asked 2016-04-15 11:58:06 -0500

DarylW gravatar image

I am attempting to add a define to the staging module and write a test for it. it contains a define staging::file.

In my define, gepetto suggests that I change my file resource to ::file so that it uses the top level resource (which I want) and not the staging::file.. However, whenever I put that in my file, I see the following when I try to run a really simple rspec test (it {should compile})

Failure/Error: it { should compile } error during compilation: Invalid tag at '::file' at /path/to/modules/staging/manifests/example.pp

Looking at the stack trace, looks like it's having errors in /usr/share/ruby/vendor_ruby/puppet/util/tagging.rb:13

If I go into a new module project with my exact code, and I change '::file' to 'file' in my manifest, I don't get any issues with my test.

I'm running my tests with $ puppet --version 3.6.2

I'll try this at home with different versions of puppet and see if I can reproduce. It looks like it cannot correctly parse a top scope reference to a define.

edit retag flag offensive close merge delete


Why not provide a link to your fork? Should be easy if I can see your code.

Alex Harvey gravatar imageAlex Harvey ( 2016-04-15 12:50:49 -0500 )edit