diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-03-15 14:28:36 -0700 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-03-20 14:38:49 -0700 |
commit | c71696269ea1865101b1857914f8afdd0a1e7e69 (patch) | |
tree | 9c952b95a7845f49a958dc17e523024a288dc486 /spec | |
parent | e374b7ba24593c4ffaaf33bca27f623e9f758925 (diff) | |
download | chef-c71696269ea1865101b1857914f8afdd0a1e7e69.tar.gz |
Useful error message when dsc resource is not found
Diffstat (limited to 'spec')
-rw-r--r-- | spec/functional/resource/dsc_resource_spec.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/functional/resource/dsc_resource_spec.rb b/spec/functional/resource/dsc_resource_spec.rb index 0279e5dbc6..a7c96e00d0 100644 --- a/spec/functional/resource/dsc_resource_spec.rb +++ b/spec/functional/resource/dsc_resource_spec.rb @@ -39,6 +39,14 @@ describe Chef::Resource::DscResource, :windows_powershell_dsc_only do } context 'when Powershell does not support Invoke-DscResource' - context 'when Powershell supports Invoke-DscResource' - + context 'when Powershell supports Invoke-DscResource' do + context 'with an invalid dsc resource' do + it 'raises an exception if the resource is not found' do + new_resource.resource 'thisdoesnotexist' + expect { new_resource.run_action(:run) }.to raise_error( + Chef::Exceptions::ResourceNotFound) + end + end + + end end |