Hi,

I have a rspec-puppet test suite for a module that uses custom types whose 
provider requires a ruby gem. Is there an easy way to mock or stub the type?

I have the following snippet in my spec file (using mocha):

---
let(:type) { Puppet::Type.type(:foo_database_user) }
  before(:each) {
    Puppet::Type.stubs(:type).with(:foo_database).returns(type)
}
---

This mocks my custom type but breaks all built-in types (like groups). 
Using a Spy looks like the obvious solution but I could not find a way to 
do that with mocha.

Thanks in advance for any help,
Florian

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/fd6f526b-83aa-47cb-9c35-e38a769477aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to