My hostsfile cookbook (https://github.com/customink-webops/hostsfile) is a good example. ChefSpec 3.0 will include some additional examples and helper methods for testing LWRPs. HWRPs can be tested like plain Ruby libraries.
Solutions Engineer, Opscode
On October 7, 2013 at 5:07:31 PM, Greg Symons (email@example.com) wrote:
Anybody know of any good (i.e. simple:) examples of writing RSpec tests
for LWRPs or HWRPs? I’ve been looking at the runit tests, but the
provider itself seems fairly complex, so seeing how to start out a new
spec is a little harder. If there’s anything simpler, especially
something that’s an LWRP, that’d be awesome.