Examples for (L|H)WRP spec tests


#1

Ohai, Chefs,

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.

Thanks,

Greg


#2

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.

Thanks
Seth Vargo
Solutions Engineer, Opscode
@sethvargo

On October 7, 2013 at 5:07:31 PM, Greg Symons (gsymons@drillinginfo.com) wrote:

Ohai, Chefs,

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.

Thanks,

Greg