summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-03-14 18:02:17 -0700
committerJay Mundrawala <jdmundrawala@gmail.com>2015-03-20 14:38:06 -0700
commit2e4f13f04f9bc25fc0646e9f3ad6c07f93f0f26f (patch)
tree41bb6708f6b8a8f3a74d86ce7099aab47b90ea9d
parent1c74de98662bf05b6d99c8f9fedbb1fff6a42b60 (diff)
downloadchef-2e4f13f04f9bc25fc0646e9f3ad6c07f93f0f26f.tar.gz
Added test for when powershell does not support Invoke-DscResource
-rw-r--r--spec/unit/provider/dsc_resource_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/unit/provider/dsc_resource_spec.rb b/spec/unit/provider/dsc_resource_spec.rb
index f3be6232dc..34705673b9 100644
--- a/spec/unit/provider/dsc_resource_spec.rb
+++ b/spec/unit/provider/dsc_resource_spec.rb
@@ -28,4 +28,17 @@ describe Chef::Provider::DscResource do
Chef::Provider::DscResource.new(resource, run_context)
end
+ context 'when Powershell does not support Invoke-DscResource' do
+ let (:node) {
+ node = Chef::Node.new
+ node.automatic[:languages][:powershell][:version] = '4.0'
+ node
+ }
+
+ it 'raises a NoProviderAvailable exception' do
+ expect(provider).not_to receive(:meta_configuration)
+ expect{provider.run_action(:run)}.to raise_error(
+ Chef::Exceptions::NoProviderAvailable, /5\.0\.10018\.0/)
+ end
+ end
end