So I'm trying to create a library of reusable custom resources. This video explains how to do that but it doesn't address testing the resource in isolation.
I know you can test a resource through a recipe and a converge, but I don't want to write a new recipe just to test my resource.
I was hoping there is some way to execute a custom resource with properties without needing to do something like below:
let(:chef_run) do
runner = ChefSpec::ServerRunner.new
runner.converge(described_recipe)
end
If you could just say something like say
filename = 'myFile'
it 'my resource should write to file' do
execute_resouce(:some_resouce).with(filename)
expect(::File).to receive(:write).with(filename)
end
it would be really cool.