The Puppet Labs Issue Tracker has Moved:

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using See the following page for information on filing tickets with JIRA:

Bug #15545

puppetlabs_spec_helper: rspec not initialised via puppet_spec_helper

Added by Dominic Cleal almost 4 years ago. Updated over 3 years ago.

Status:UnreviewedStart date:07/16/2012
Priority:NormalDue date:
Assignee:-% Done:


Category:spec_helperSpent time:-
Target version:-
Keywords: Branch:

We've Moved!

Ticket tracking is now hosted in JIRA:


If a project requires puppetlabs_spec_helper/puppet_spec_helper directly then rspec doesn’t seem to be initialised correctly. If you instead require module_spec_helper then it does, perhaps due to rspec-puppet being pulled in.

From my augeasproviders project, I get:

/home/dcleal/.gem/ruby/1.9.1/gems/puppetlabs_spec_helper- `<module:RSpec>': cannot load such file -- rspec/matchers (LoadError)
    from /home/dcleal/.gem/ruby/1.9.1/gems/puppetlabs_spec_helper- `<top (required)>'

From puppetlabs-mount_providers (after changing the require, as per #15543):

/home/dcleal/.gem/ruby/1.9.1/gems/puppetlabs_spec_helper- `alias_method': undefined method `should' for module `RSpec::Matchers::BlockAliases' (NameError)
    from /home/dcleal/.gem/ruby/1.9.1/gems/puppetlabs_spec_helper- `<module:BlockAliases>'

These stop if you edit puppet_spec_helper.rb and move the requires for mocha, rspec and rspec/expectations to be above the require for puppetlabs_spec_helper/puppetlabs_spec_helper (the latter seems to start setting up matchers).

This seems related to PR 10, which seems to have worked around it for the coverage task but perhaps not truly fixed the issue.

Related issues

Blocks Puppet Labs Modules - Bug #15543: mount_providers doesn't load puppetlabs_spec_helper corre... Unreviewed 07/16/2012


#1 Updated by Ryan Coleman over 3 years ago

  • Category set to spec_helper

Also available in: Atom PDF