summaryrefslogtreecommitdiff
path: root/spec/unit/provider/dsc_resource_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/provider/dsc_resource_spec.rb')
-rw-r--r--spec/unit/provider/dsc_resource_spec.rb32
1 files changed, 16 insertions, 16 deletions
diff --git a/spec/unit/provider/dsc_resource_spec.rb b/spec/unit/provider/dsc_resource_spec.rb
index 2c9ad53054..8613ce4af4 100644
--- a/spec/unit/provider/dsc_resource_spec.rb
+++ b/spec/unit/provider/dsc_resource_spec.rb
@@ -20,10 +20,10 @@ require "chef"
require "spec_helper"
describe Chef::Provider::DscResource do
- let (:events) { Chef::EventDispatch::Dispatcher.new }
- let (:run_context) { Chef::RunContext.new(node, {}, events) }
- let (:resource) { Chef::Resource::DscResource.new("dscresource", run_context) }
- let (:provider) do
+ let(:events) { Chef::EventDispatch::Dispatcher.new }
+ let(:run_context) { Chef::RunContext.new(node, {}, events) }
+ let(:resource) { Chef::Resource::DscResource.new("dscresource", run_context) }
+ let(:provider) do
Chef::Provider::DscResource.new(resource, run_context)
end
@@ -34,7 +34,7 @@ describe Chef::Provider::DscResource do
end
context "when PowerShell does not support Invoke-DscResource" do
- let (:node) do
+ let(:node) do
node = Chef::Node.new
node.automatic[:languages][:powershell][:version] = "4.0"
node
@@ -51,7 +51,7 @@ describe Chef::Provider::DscResource do
context "when RefreshMode is not set to Disabled" do
context "and the WMF 5 is a preview release" do
- let (:node) do
+ let(:node) do
node = Chef::Node.new
node.automatic[:languages][:powershell][:version] = "5.0.10018.0"
node
@@ -64,7 +64,7 @@ describe Chef::Provider::DscResource do
end
end
context "and the WMF is 5 RTM or newer" do
- let (:node) do
+ let(:node) do
node = Chef::Node.new
node.automatic[:languages][:powershell][:version] = "5.0.10586.0"
node
@@ -80,15 +80,15 @@ describe Chef::Provider::DscResource do
end
context "when the LCM supports Invoke-DscResource" do
- let (:node) do
+ let(:node) do
node = Chef::Node.new
node.automatic[:languages][:powershell][:version] = "5.0.10018.0"
node
end
- let (:resource_result) { double("CmdletResult", return_value: { "InDesiredState" => true }, stream: "description") }
- let (:invoke_dsc_resource) { double("cmdlet", run!: resource_result) }
- let (:store) { double("ResourceStore", find: resource_records) }
- let (:resource_records) { [] }
+ let(:resource_result) { double("CmdletResult", return_value: { "InDesiredState" => true }, stream: "description") }
+ let(:invoke_dsc_resource) { double("cmdlet", run!: resource_result) }
+ let(:store) { double("ResourceStore", find: resource_records) }
+ let(:resource_records) { [] }
before do
allow(Chef::Util::DSC::ResourceStore).to receive(:instance).and_return(store)
@@ -130,7 +130,7 @@ describe Chef::Provider::DscResource do
end
context "resource name cannot be found" do
- let (:resource_records) { [] }
+ let(:resource_records) { [] }
it "raises ResourceNotFound" do
expect { provider.run_action(:run) }.to raise_error(Chef::Exceptions::ResourceNotFound)
@@ -139,7 +139,7 @@ describe Chef::Provider::DscResource do
context "resource name is found" do
context "no module name for resource found" do
- let (:resource_records) { [{}] }
+ let(:resource_records) { [{}] }
it "returns the default dsc resource module" do
expect(Chef::Util::Powershell::Cmdlet).to receive(:new) do |node, cmdlet, format|
@@ -150,7 +150,7 @@ describe Chef::Provider::DscResource do
end
context "a module name for resource is found" do
- let (:resource_records) { [{ "Module" => { "Name" => "ModuleName" } }] }
+ let(:resource_records) { [{ "Module" => { "Name" => "ModuleName" } }] }
it "returns the default dsc resource module" do
expect(Chef::Util::Powershell::Cmdlet).to receive(:new) do |node, cmdlet, format|
@@ -161,7 +161,7 @@ describe Chef::Provider::DscResource do
end
context "multiple resource are found" do
- let (:resource_records) do
+ let(:resource_records) do
[
{ "Module" => { "Name" => "ModuleName1", "Version" => "1.0.0.0" } },
{ "Module" => { "Name" => "ModuleName1", "Version" => "2.0.0.0" } },