summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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