summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-03-15 14:28:36 -0700
committerJay Mundrawala <jdmundrawala@gmail.com>2015-03-20 14:38:49 -0700
commitc71696269ea1865101b1857914f8afdd0a1e7e69 (patch)
tree9c952b95a7845f49a958dc17e523024a288dc486 /spec
parente374b7ba24593c4ffaaf33bca27f623e9f758925 (diff)
downloadchef-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.rb12
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