On Tue, Mar 6, 2012 at 10:53 PM, R. Tyler Croy <ty...@monkeypox.org> wrote:
> My module now depends on the puppetlabs/puppet-apt module for supporting > Debian/Ubuntu hosts, doing this however broke all my debian/ubuntu related > rspec-puppet tests. > > Is there a reasonable way to mock out resources (like apt::source, etc) to > just > test that my classes are doing what they should be doing? > Not that I know of. rspec-puppet is testing the catalog itself and we don't have a clean way to put mock resources in the catalog. What's the breakage look like? I usually treat this sort of issue as a code smell. Ideally, one module will simply require Class resources from other modules rather than specific resources inside the class. In this situation all you need to do is declare a class with the same name in your spec tests to satisfy the dependency. Make sense? -Jeff -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.