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:

Feature #3138

Improve procedure for enabling rspec tests in modules

Added by Mike Pountney about 6 years ago. Updated over 3 years ago.

Status:AcceptedStart date:02/01/2010
Priority:NormalDue date:
Assignee:-% Done:


Target version:-
Affected Puppet version:0.25.4 Branch:

We've Moved!

Ticket tracking is now hosted in JIRA:


I’m logging this at the request of James Turnbull:

I’ve recently started on my first puppet custom type/provider, and decided to try to do this a) in a module, and b) with rspec tests.

I was able to get spec tests running, but with quite a bit of hackery, copying files from the main puppet repo:


test/lib test/lib/puppettest test/lib/puppettest/certificates.rb test/lib/puppettest/exetest.rb test/lib/puppettest/fakes.rb test/lib/puppettest/fileparsing.rb test/lib/puppettest/filetesting.rb test/lib/puppettest/parsertesting.rb test/lib/puppettest/railstesting.rb test/lib/puppettest/reporttesting.rb test/lib/puppettest/resourcetesting.rb test/lib/puppettest/runnable_test.rb test/lib/puppettest/servertest.rb test/lib/puppettest/support test/lib/puppettest/support/assertions.rb test/lib/puppettest/support/collection.rb test/lib/puppettest/support/helpers.rb test/lib/puppettest/support/resources.rb test/lib/puppettest/support/utils.rb test/lib/puppettest/support.rb test/lib/puppettest/testcase.rb test/lib/puppettest.rb

Honestly, I haven’t worked out which of these libs are totally required, but puppettest.rb is at a minimum. (puppettest/runnable_test.rb seems to be unrequired so far, except for being called in spec_helper.rb)

Is there a way that this can be made easier? Developing types in modules seems to be a sensible way to go after all – it should allow folk on any client version to add a new type, rather than requiring they upgrade to puppet-latest.

My vcsrepo module (based now on James' tutorial at btw) is located at:

Naturally, i’m more than happy to help with this work, but my knowledge of the puppet codebase and Rspec framework is very limited.


#1 Updated by James Turnbull about 6 years ago

  • Category set to testing
  • Status changed from Unreviewed to Needs Decision
  • Assignee set to Luke Kanies
  • Target version set to 2.7.x

#2 Updated by Luke Kanies about 6 years ago

  • Status changed from Needs Decision to Accepted
  • Assignee deleted (Luke Kanies)

I definitely think this is a good idea, but I think overall it’s probably best within the context of a tool like gepetto – you have something on your system that expects a given convention, and that thing makes modules that follow the convention easy to test.

#3 Updated by Anonymous over 3 years ago

  • Target version deleted (2.7.x)

Also available in: Atom PDF