Hi, I'm adding the feature :libuser to Puppet::Type::Group. In the groupadd provider, having the feature libuser and setting forcelocal => true will cause the invoked command to be lgroupadd instead of groupadd. I want to write a test case for both when the libuser feature is present and when its not.
I'm seeing a lot of test cases written like: describe "on system that feature system_groups", :if => described_class.system_groups? do This appears to restrict the test case from being run only on systems that actually support the system_groups feature. I would like to write a test case that, within the groupadd provider, emulates both having and not having the libuser feature and making sure that the command lgroupadd and groupadd are used respectively. I thought I could accomplish this by executing provider.stubs(:feature?).with(:libuser).returns(true) But I end up getting unexpected invocation errors because provider.features? gets executed by Puppet::Type::Group with other parameters than :libuser. Here's the full details: https://github.com/jjulien/puppet/commit/c89c65fd703f20d539966f42fe4cb826bd1ca6b7 Any advice on the test case would be greatly appreciated. John -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-dev/-/FJ5d2xZyEfcJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
