diff options
author | Thom May <thom@chef.io> | 2016-01-14 14:08:03 +0000 |
---|---|---|
committer | Thom May <thom@chef.io> | 2016-01-14 14:08:03 +0000 |
commit | 51cfbdc4d16739caac4d946fadbe678444aafe34 (patch) | |
tree | 56dfd8f1cd9fd933de27268b32402e955a43ac2b /spec/unit/platform | |
parent | 05064423057d4cf46f4713b81b08829cf6d20af6 (diff) | |
download | chef-51cfbdc4d16739caac4d946fadbe678444aafe34.tar.gz |
Use double quotes by default
This is an entirely mechanically generated (chefstyle -a) change, to go
along with chef/chefstyle#5 . We should pick something and use it
consistently, and my opinion is that double quotes are the appropriate
thing.
Diffstat (limited to 'spec/unit/platform')
-rw-r--r-- | spec/unit/platform/query_helpers_spec.rb | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/spec/unit/platform/query_helpers_spec.rb b/spec/unit/platform/query_helpers_spec.rb index d18b6f7902..3905b15071 100644 --- a/spec/unit/platform/query_helpers_spec.rb +++ b/spec/unit/platform/query_helpers_spec.rb @@ -16,7 +16,7 @@ # limitations under the License. # -require 'spec_helper' +require "spec_helper" describe "Chef::Platform#windows_server_2003?" do it "returns false early when not on windows" do @@ -51,8 +51,8 @@ describe "Chef::Platform#windows_nano_server?" do end after do - Win32::Registry.send(:remove_const, 'HKEY_LOCAL_MACHINE') if defined?(Win32::Registry::HKEY_LOCAL_MACHINE) - Win32::Registry.send(:remove_const, 'KEY_QUERY_VALUE') if defined?(Win32::Registry::KEY_QUERY_VALUE) + Win32::Registry.send(:remove_const, "HKEY_LOCAL_MACHINE") if defined?(Win32::Registry::HKEY_LOCAL_MACHINE) + Win32::Registry.send(:remove_const, "KEY_QUERY_VALUE") if defined?(Win32::Registry::KEY_QUERY_VALUE) end it "returns false early when not on windows" do @@ -63,7 +63,7 @@ describe "Chef::Platform#windows_nano_server?" do it "returns true when the registry value is 1" do allow(ChefConfig).to receive(:windows?).and_return(true) - allow(Chef::Platform).to receive(:require).with('win32/registry') + allow(Chef::Platform).to receive(:require).with("win32/registry") expect(Win32::Registry::HKEY_LOCAL_MACHINE).to receive(:open). with(key, access). and_yield(registry) @@ -73,7 +73,7 @@ describe "Chef::Platform#windows_nano_server?" do it "returns false when the registry value is not 1" do allow(ChefConfig).to receive(:windows?).and_return(true) - allow(Chef::Platform).to receive(:require).with('win32/registry') + allow(Chef::Platform).to receive(:require).with("win32/registry") expect(Win32::Registry::HKEY_LOCAL_MACHINE).to receive(:open). with(key, access). and_yield(registry) @@ -83,7 +83,7 @@ describe "Chef::Platform#windows_nano_server?" do it "returns false when the registry value does not exist" do allow(ChefConfig).to receive(:windows?).and_return(true) - allow(Chef::Platform).to receive(:require).with('win32/registry') + allow(Chef::Platform).to receive(:require).with("win32/registry") expect(Win32::Registry::HKEY_LOCAL_MACHINE).to receive(:open). with(key, access). and_yield(registry) @@ -94,7 +94,7 @@ describe "Chef::Platform#windows_nano_server?" do it "returns false when the registry key does not exist" do allow(ChefConfig).to receive(:windows?).and_return(true) - allow(Chef::Platform).to receive(:require).with('win32/registry') + allow(Chef::Platform).to receive(:require).with("win32/registry") expect(Win32::Registry::HKEY_LOCAL_MACHINE).to receive(:open). with(key, access). and_raise(Win32::Registry::Error, "The system cannot find the file specified.") @@ -122,8 +122,8 @@ describe "Chef::Platform#supports_msi?" do end after do - Win32::Registry.send(:remove_const, 'HKEY_LOCAL_MACHINE') if defined?(Win32::Registry::HKEY_LOCAL_MACHINE) - Win32::Registry.send(:remove_const, 'KEY_QUERY_VALUE') if defined?(Win32::Registry::KEY_QUERY_VALUE) + Win32::Registry.send(:remove_const, "HKEY_LOCAL_MACHINE") if defined?(Win32::Registry::HKEY_LOCAL_MACHINE) + Win32::Registry.send(:remove_const, "KEY_QUERY_VALUE") if defined?(Win32::Registry::KEY_QUERY_VALUE) end it "returns false early when not on windows" do @@ -134,7 +134,7 @@ describe "Chef::Platform#supports_msi?" do it "returns true when the registry key exists" do allow(ChefConfig).to receive(:windows?).and_return(true) - allow(Chef::Platform).to receive(:require).with('win32/registry') + allow(Chef::Platform).to receive(:require).with("win32/registry") expect(Win32::Registry::HKEY_LOCAL_MACHINE).to receive(:open). with(key, access). and_yield(registry) @@ -143,7 +143,7 @@ describe "Chef::Platform#supports_msi?" do it "returns false when the registry key does not exist" do allow(ChefConfig).to receive(:windows?).and_return(true) - allow(Chef::Platform).to receive(:require).with('win32/registry') + allow(Chef::Platform).to receive(:require).with("win32/registry") expect(Win32::Registry::HKEY_LOCAL_MACHINE).to receive(:open). with(key, access). and_raise(Win32::Registry::Error, "The system cannot find the file specified.") @@ -152,12 +152,12 @@ describe "Chef::Platform#supports_msi?" do end describe 'Chef::Platform#supports_dsc?' do - it 'returns false if powershell is not present' do + it "returns false if powershell is not present" do node = Chef::Node.new expect(Chef::Platform.supports_dsc?(node)).to be_falsey end - ['1.0', '2.0', '3.0'].each do |version| + ["1.0", "2.0", "3.0"].each do |version| it "returns false for Powershell #{version}" do node = Chef::Node.new node.automatic[:languages][:powershell][:version] = version @@ -165,7 +165,7 @@ describe 'Chef::Platform#supports_dsc?' do end end - ['4.0', '5.0'].each do |version| + ["4.0", "5.0"].each do |version| it "returns true for Powershell #{version}" do node = Chef::Node.new node.automatic[:languages][:powershell][:version] = version @@ -175,12 +175,12 @@ describe 'Chef::Platform#supports_dsc?' do end describe 'Chef::Platform#supports_dsc_invoke_resource?' do - it 'returns false if powershell is not present' do + it "returns false if powershell is not present" do node = Chef::Node.new expect(Chef::Platform.supports_dsc_invoke_resource?(node)).to be_falsey end - ['1.0', '2.0', '3.0', '4.0', '5.0.10017.9'].each do |version| + ["1.0", "2.0", "3.0", "4.0", "5.0.10017.9"].each do |version| it "returns false for Powershell #{version}" do node = Chef::Node.new node.automatic[:languages][:powershell][:version] = version @@ -196,16 +196,16 @@ describe 'Chef::Platform#supports_dsc_invoke_resource?' do end describe 'Chef::Platform#dsc_refresh_mode_disabled?' do - let(:node) { instance_double('Chef::Node') } - let(:cmdlet) { instance_double('Chef::Util::Powershell::Cmdlet') } - let(:cmdlet_result) { instance_double('Chef::Util::Powershell::CmdletResult')} + let(:node) { instance_double("Chef::Node") } + let(:cmdlet) { instance_double("Chef::Util::Powershell::Cmdlet") } + let(:cmdlet_result) { instance_double("Chef::Util::Powershell::CmdletResult")} it "returns true when RefreshMode is Disabled" do expect(Chef::Util::Powershell::Cmdlet).to receive(:new). with(node, "Get-DscLocalConfigurationManager", :object). and_return(cmdlet) expect(cmdlet).to receive(:run!).and_return(cmdlet_result) - expect(cmdlet_result).to receive(:return_value).and_return({ 'RefreshMode' => 'Disabled' }) + expect(cmdlet_result).to receive(:return_value).and_return({ "RefreshMode" => "Disabled" }) expect(Chef::Platform.dsc_refresh_mode_disabled?(node)).to be true end @@ -214,7 +214,7 @@ describe 'Chef::Platform#dsc_refresh_mode_disabled?' do with(node, "Get-DscLocalConfigurationManager", :object). and_return(cmdlet) expect(cmdlet).to receive(:run!).and_return(cmdlet_result) - expect(cmdlet_result).to receive(:return_value).and_return({ 'RefreshMode' => 'LaLaLa' }) + expect(cmdlet_result).to receive(:return_value).and_return({ "RefreshMode" => "LaLaLa" }) expect(Chef::Platform.dsc_refresh_mode_disabled?(node)).to be false end end |