If I use a template resource in a recipe
template '/home/user1/foo' do
source 'bar'
end
And I test using chefspec/rspec
...
expect(chef_run).to render_file('/home/user1/foo')
expect(chef_run).to create_template('/home/user1/foo')
expect(chef_run).to create_template('/home/user1/foo').with_source 'bar
...
All tests pass...
even if the source template "bar" is missing from the cookbook.
This leaves me with a cookbook that passes all the tests I can think of, but will fail when I try to run it. Same for a cookbook_file resource.
I can see how it would be a can of worms to test all the places where the resource could look for the source file (per the "File Specificity" section in the resource docs) but it still seems like a big hole in the test tools.
Am I overlooking a way to test for the existence of the source file, or doing something wrong at a more basic level? Or is this just how it is, and everyone lives with it?