diff options
Diffstat (limited to 'spec/unit/provider')
-rw-r--r-- | spec/unit/provider/cron/unix_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/provider/dsc_resource_spec.rb | 32 | ||||
-rw-r--r-- | spec/unit/provider/dsc_script_spec.rb | 20 | ||||
-rw-r--r-- | spec/unit/provider/git_spec.rb | 6 | ||||
-rw-r--r-- | spec/unit/provider/package/openbsd_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/provider/package/windows/registry_uninstall_entry_spec.rb | 6 | ||||
-rw-r--r-- | spec/unit/provider/user/dscl_spec.rb | 4 |
7 files changed, 36 insertions, 36 deletions
diff --git a/spec/unit/provider/cron/unix_spec.rb b/spec/unit/provider/cron/unix_spec.rb index c8ef82e37a..e5bb436bea 100644 --- a/spec/unit/provider/cron/unix_spec.rb +++ b/spec/unit/provider/cron/unix_spec.rb @@ -93,7 +93,7 @@ describe Chef::Provider::Cron::Unix do end context "when any other error occurs" do - let (:exitstatus) { 2 } + let(:exitstatus) { 2 } it "should raise an exception if another error occurs" do expect do 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" } }, diff --git a/spec/unit/provider/dsc_script_spec.rb b/spec/unit/provider/dsc_script_spec.rb index 520f784ced..f0a63e0a5b 100644 --- a/spec/unit/provider/dsc_script_spec.rb +++ b/spec/unit/provider/dsc_script_spec.rb @@ -23,15 +23,15 @@ require "spec_helper" describe Chef::Provider::DscScript do context "when DSC is available" do - let (:node) do + let(:node) do node = Chef::Node.new node.automatic[:languages][:powershell][:version] = "4.0" node end - let (:events) { Chef::EventDispatch::Dispatcher.new } - let (:run_context) { Chef::RunContext.new(node, {}, events) } - let (:resource) { Chef::Resource::DscScript.new("script", run_context) } - let (:provider) do + let(:events) { Chef::EventDispatch::Dispatcher.new } + let(:run_context) { Chef::RunContext.new(node, {}, events) } + let(:resource) { Chef::Resource::DscScript.new("script", run_context) } + let(:provider) do Chef::Provider::DscScript.new(resource, run_context) end @@ -145,11 +145,11 @@ describe Chef::Provider::DscScript do end context "when Dsc is not available" do - let (:node) { Chef::Node.new } - let (:events) { Chef::EventDispatch::Dispatcher.new } - let (:run_context) { Chef::RunContext.new(node, {}, events) } - let (:resource) { Chef::Resource::DscScript.new("script", run_context) } - let (:provider) { Chef::Provider::DscScript.new(resource, run_context) } + let(:node) { Chef::Node.new } + let(:events) { Chef::EventDispatch::Dispatcher.new } + let(:run_context) { Chef::RunContext.new(node, {}, events) } + let(:resource) { Chef::Resource::DscScript.new("script", run_context) } + let(:provider) { Chef::Provider::DscScript.new(resource, run_context) } describe "action_run" do ["1.0", "2.0", "3.0"].each do |version| diff --git a/spec/unit/provider/git_spec.rb b/spec/unit/provider/git_spec.rb index 078e6109dc..21af554111 100644 --- a/spec/unit/provider/git_spec.rb +++ b/spec/unit/provider/git_spec.rb @@ -293,7 +293,7 @@ describe Chef::Provider::Git do end end context "with a timeout set" do - let (:seconds) { 10 } + let(:seconds) { 10 } before { @resource.timeout(seconds) } it "clones a repo with amended git options" do expect(@provider).to receive(:shell_out!).with(expected_cmd, default_options.merge(timeout: seconds)) @@ -301,7 +301,7 @@ describe Chef::Provider::Git do end end context "with a specific home" do - let (:override_home) do + let(:override_home) do { "HOME" => "/home/masterNinja" } end let(:overrided_options) do @@ -337,7 +337,7 @@ describe Chef::Provider::Git do allow(Etc).to receive(:getpwuid).and_return(double("Struct::Passwd", name: @resource.user, dir: "/home/deployNinja")) end context "with a specific home" do - let (:override_home) do + let(:override_home) do { "HOME" => "/home/masterNinja" } end let(:overrided_options) do diff --git a/spec/unit/provider/package/openbsd_spec.rb b/spec/unit/provider/package/openbsd_spec.rb index dee49534c3..154e5ba333 100644 --- a/spec/unit/provider/package/openbsd_spec.rb +++ b/spec/unit/provider/package/openbsd_spec.rb @@ -27,7 +27,7 @@ describe Chef::Provider::Package::Openbsd do node end - let (:provider) do + let(:provider) do events = Chef::EventDispatch::Dispatcher.new run_context = Chef::RunContext.new(node, {}, events) Chef::Provider::Package::Openbsd.new(new_resource, run_context) diff --git a/spec/unit/provider/package/windows/registry_uninstall_entry_spec.rb b/spec/unit/provider/package/windows/registry_uninstall_entry_spec.rb index 803f3271df..9ce1151285 100644 --- a/spec/unit/provider/package/windows/registry_uninstall_entry_spec.rb +++ b/spec/unit/provider/package/windows/registry_uninstall_entry_spec.rb @@ -8,7 +8,7 @@ describe Chef::Provider::Package::Windows::RegistryUninstallEntry do describe "when QuietUninstallString key not present" do let(:quiet_uninstall_string) { nil } - let (:quiet_uninstall_string_key) { Chef::Provider::Package::Windows::RegistryUninstallEntry.quiet_uninstall_string_key?(quiet_uninstall_string, hkey, key, entry).uninstall_string } + let(:quiet_uninstall_string_key) { Chef::Provider::Package::Windows::RegistryUninstallEntry.quiet_uninstall_string_key?(quiet_uninstall_string, hkey, key, entry).uninstall_string } it "returns UninstallString key value" do expect(quiet_uninstall_string_key).to eql "UninstallStringPath" end @@ -16,14 +16,14 @@ describe Chef::Provider::Package::Windows::RegistryUninstallEntry do describe "when QuietUninstallString key present" do let(:quiet_uninstall_string) { "QuietUninstallString" } - let (:quiet_uninstall_string_key) { Chef::Provider::Package::Windows::RegistryUninstallEntry.quiet_uninstall_string_key?(quiet_uninstall_string, hkey, key, entry).uninstall_string } + let(:quiet_uninstall_string_key) { Chef::Provider::Package::Windows::RegistryUninstallEntry.quiet_uninstall_string_key?(quiet_uninstall_string, hkey, key, entry).uninstall_string } it "returns QuietUninstallString key value" do expect(quiet_uninstall_string_key).to eql "QuietUninstallStringPath" end end describe ".find_entries", :windows_only do - let (:registry_uninstall_entry) { Chef::Provider::Package::Windows::RegistryUninstallEntry } + let(:registry_uninstall_entry) { Chef::Provider::Package::Windows::RegistryUninstallEntry } before(:each) do allow_any_instance_of(::Win32::Registry).to receive(:open).and_return("::Win32::Registry::HKEY_CURRENT_USER") end diff --git a/spec/unit/provider/user/dscl_spec.rb b/spec/unit/provider/user/dscl_spec.rb index d72d7e8c8e..5652ae6868 100644 --- a/spec/unit/provider/user/dscl_spec.rb +++ b/spec/unit/provider/user/dscl_spec.rb @@ -30,7 +30,7 @@ describe Chef::Provider::User::Dscl do let(:salt) { nil } let(:iterations) { nil } - let (:events) { Chef::EventDispatch::Dispatcher.new } + let(:events) { Chef::EventDispatch::Dispatcher.new } let(:node) do Chef::Node.new.tap do |node| @@ -39,7 +39,7 @@ describe Chef::Provider::User::Dscl do end end - let (:run_context) { Chef::RunContext.new(node, {}, events) } + let(:run_context) { Chef::RunContext.new(node, {}, events) } let(:new_resource) do r = Chef::Resource::User::DsclUser.new("toor", run_context) |