diff options
author | Pete Higgins <pete@peterhiggins.org> | 2020-06-24 13:11:27 -0700 |
---|---|---|
committer | Pete Higgins <pete@peterhiggins.org> | 2020-06-24 17:47:50 -0700 |
commit | b7365397f410767234619d94129757c48b8d9456 (patch) | |
tree | 8225d25eac794fbdc113821ebf33916920b27ffa | |
parent | c7933fc1112a92ff2ebee80fbea0661766ec933b (diff) | |
download | chef-b7365397f410767234619d94129757c48b8d9456.tar.gz |
Fix some odd whitespacing in tests.
Signed-off-by: Pete Higgins <pete@peterhiggins.org>
34 files changed, 83 insertions, 83 deletions
diff --git a/spec/functional/knife/configure_spec.rb b/spec/functional/knife/configure_spec.rb index 78e2e801bc..8f2a5b4d6e 100644 --- a/spec/functional/knife/configure_spec.rb +++ b/spec/functional/knife/configure_spec.rb @@ -21,7 +21,7 @@ require "spec_helper" require "chef/knife/configure" describe "knife configure" do - let (:ohai) do + let(:ohai) do OHAI_SYSTEM end diff --git a/spec/functional/resource/bash_spec.rb b/spec/functional/resource/bash_spec.rb index acebc312ee..bc61bbd579 100644 --- a/spec/functional/resource/bash_spec.rb +++ b/spec/functional/resource/bash_spec.rb @@ -28,7 +28,7 @@ describe Chef::Resource::Bash, :unix_only do end describe "when setting the command property" do - let (:command) { "wizard racket" } + let(:command) { "wizard racket" } it "should raise an exception when trying to set the command" do expect { resource.command command }.to raise_error(Chef::Exceptions::Script) diff --git a/spec/functional/resource/insserv_spec.rb b/spec/functional/resource/insserv_spec.rb index 6d66516bab..51ea064f32 100644 --- a/spec/functional/resource/insserv_spec.rb +++ b/spec/functional/resource/insserv_spec.rb @@ -65,7 +65,7 @@ describe Chef::Resource::Service, :requires_root, :opensuse do provider end - let (:service_name) { "Chef::Util::PathHelper.escape_glob_dir(current_resource.service_name)" } + let(:service_name) { "Chef::Util::PathHelper.escape_glob_dir(current_resource.service_name)" } let(:current_resource) do provider.load_current_resource diff --git a/spec/functional/resource/powershell_script_spec.rb b/spec/functional/resource/powershell_script_spec.rb index b74cfc6116..5e8a00fd4d 100644 --- a/spec/functional/resource/powershell_script_spec.rb +++ b/spec/functional/resource/powershell_script_spec.rb @@ -23,8 +23,8 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do include_context Chef::Resource::WindowsScript - let (:architecture_command) { "echo $env:PROCESSOR_ARCHITECTURE" } - let (:output_command) { " | out-file -encoding ASCII " } + let(:architecture_command) { "echo $env:PROCESSOR_ARCHITECTURE" } + let(:output_command) { " | out-file -encoding ASCII " } it_behaves_like "a Windows script running on Windows" @@ -68,8 +68,8 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do end end - let (:negative_exit_status) { -27 } - let (:unsigned_exit_status) { (-negative_exit_status ^ 65535) + 1 } + let(:negative_exit_status) { -27 } + let(:unsigned_exit_status) { (-negative_exit_status ^ 65535) + 1 } it "returns the exit status -27 as a signed integer or an unsigned 16-bit 2's complement value of 65509 for a powershell script that exits with -27" do # Versions of PowerShell prior to 4.0 return a 16-bit unsigned value -- diff --git a/spec/functional/resource/remote_file_spec.rb b/spec/functional/resource/remote_file_spec.rb index a5ae59d876..f4a3d5346d 100644 --- a/spec/functional/resource/remote_file_spec.rb +++ b/spec/functional/resource/remote_file_spec.rb @@ -229,8 +229,8 @@ describe Chef::Resource::RemoteFile do end context "when the resource is accessed using an alternate user's identity with no access to the file" do - let (:windows_nonadmin_user) { "chefremfile1" } - let (:windows_nonadmin_user_password) { "j82ajfxK3;2Xe1" } + let(:windows_nonadmin_user) { "chefremfile1" } + let(:windows_nonadmin_user_password) { "j82ajfxK3;2Xe1" } include_context "a non-admin Windows user" before do @@ -246,8 +246,8 @@ describe Chef::Resource::RemoteFile do end context "when the the file is only accessible as a specific alternate identity" do - let (:windows_nonadmin_user) { "chefremfile2" } - let (:windows_nonadmin_user_password) { "j82ajfxK3;2Xe2" } + let(:windows_nonadmin_user) { "chefremfile2" } + let(:windows_nonadmin_user_password) { "j82ajfxK3;2Xe2" } include_context "a non-admin Windows user" before do @@ -279,8 +279,8 @@ describe Chef::Resource::RemoteFile do end context "when the resource is accessed using an alternate user's identity with no access to the file" do - let (:windows_nonadmin_user) { "chefremfile3" } - let (:windows_nonadmin_user_password) { "j82ajfxK3;2Xe3" } + let(:windows_nonadmin_user) { "chefremfile3" } + let(:windows_nonadmin_user_password) { "j82ajfxK3;2Xe3" } include_context "a non-admin Windows user" let(:remote_user) { windows_nonadmin_user_qualified } diff --git a/spec/functional/win32/crypto_spec.rb b/spec/functional/win32/crypto_spec.rb index c120132217..b0f2d3af5d 100644 --- a/spec/functional/win32/crypto_spec.rb +++ b/spec/functional/win32/crypto_spec.rb @@ -32,7 +32,7 @@ describe "Chef::ReservedNames::Win32::Crypto", :windows_only do @run_context = Chef::RunContext.new(new_node, {}, events) end - let (:plaintext) { "p@assword" } + let(:plaintext) { "p@assword" } it "can be decrypted by powershell" do encrypted = Chef::ReservedNames::Win32::Crypto.encrypt(plaintext) diff --git a/spec/integration/knife/cookbook_upload_spec.rb b/spec/integration/knife/cookbook_upload_spec.rb index d8077ac2c6..79a9efbfb7 100644 --- a/spec/integration/knife/cookbook_upload_spec.rb +++ b/spec/integration/knife/cookbook_upload_spec.rb @@ -25,7 +25,7 @@ describe "knife cookbook upload", :workstation do include_context "default config options" - let (:cb_dir) { "#{@repository_dir}/cookbooks" } + let(:cb_dir) { "#{@repository_dir}/cookbooks" } when_the_chef_server "is empty" do when_the_repository "has a cookbook" do diff --git a/spec/integration/knife/data_bag_from_file_spec.rb b/spec/integration/knife/data_bag_from_file_spec.rb index ee5757bebd..93801226d0 100644 --- a/spec/integration/knife/data_bag_from_file_spec.rb +++ b/spec/integration/knife/data_bag_from_file_spec.rb @@ -24,7 +24,7 @@ describe "knife data bag from file", :workstation do include_context "default config options" - let (:db_dir) { "#{@repository_dir}/data_bags" } + let(:db_dir) { "#{@repository_dir}/data_bags" } when_the_chef_server "has an empty data bag" do before do diff --git a/spec/integration/knife/environment_from_file_spec.rb b/spec/integration/knife/environment_from_file_spec.rb index 2eafa5a935..f9d35f4d47 100644 --- a/spec/integration/knife/environment_from_file_spec.rb +++ b/spec/integration/knife/environment_from_file_spec.rb @@ -24,7 +24,7 @@ describe "knife environment from file", :workstation do # include_context "default config options" - let (:env_dir) { "#{@repository_dir}/environments" } + let(:env_dir) { "#{@repository_dir}/environments" } when_the_chef_server "is empty" do when_the_repository "has some environments" do diff --git a/spec/integration/knife/node_from_file_spec.rb b/spec/integration/knife/node_from_file_spec.rb index c3ecaf4af8..6f7e0780f0 100644 --- a/spec/integration/knife/node_from_file_spec.rb +++ b/spec/integration/knife/node_from_file_spec.rb @@ -24,7 +24,7 @@ describe "knife node from file", :workstation do # include_context "default config options" - let (:node_dir) { "#{@repository_dir}/nodes" } + let(:node_dir) { "#{@repository_dir}/nodes" } when_the_chef_server "is empty" do when_the_repository "has some nodes" do diff --git a/spec/integration/knife/role_from_file_spec.rb b/spec/integration/knife/role_from_file_spec.rb index 395528937a..4a2912935c 100644 --- a/spec/integration/knife/role_from_file_spec.rb +++ b/spec/integration/knife/role_from_file_spec.rb @@ -24,7 +24,7 @@ describe "knife role from file", :workstation do # include_context "default config options" - let (:role_dir) { "#{@repository_dir}/roles" } + let(:role_dir) { "#{@repository_dir}/roles" } when_the_chef_server "is empty" do when_the_repository "has some roles" do diff --git a/spec/integration/recipes/resource_load_spec.rb b/spec/integration/recipes/resource_load_spec.rb index 52a108a766..dec482f5c9 100644 --- a/spec/integration/recipes/resource_load_spec.rb +++ b/spec/integration/recipes/resource_load_spec.rb @@ -119,10 +119,10 @@ describe "Resource.load_current_value" do end end - let (:subresource_name) do + let(:subresource_name) do :"load_current_value_subresource_dsl#{Namer.current_index}" end - let (:subresource_class) do + let(:subresource_class) do r = Class.new(resource_class) do property :y, default: lazy { "default_y #{Namer.incrementing_value}" } end diff --git a/spec/support/shared/functional/securable_resource.rb b/spec/support/shared/functional/securable_resource.rb index 23e95732c9..7bbd7d1666 100644 --- a/spec/support/shared/functional/securable_resource.rb +++ b/spec/support/shared/functional/securable_resource.rb @@ -135,7 +135,7 @@ shared_context "use Windows permissions", :windows_only do } end - let (:write_flag) { 3 } + let(:write_flag) { 3 } RSpec::Matchers.define :have_expected_properties do |mask, type, flags| match do |ace| diff --git a/spec/support/shared/functional/windows_script.rb b/spec/support/shared/functional/windows_script.rb index 7747524d03..3ccb7b6e37 100644 --- a/spec/support/shared/functional/windows_script.rb +++ b/spec/support/shared/functional/windows_script.rb @@ -91,7 +91,7 @@ shared_context Chef::Resource::WindowsScript do end context "when the guard's architecture is specified as 64-bit" do - let (:guard_architecture) { :x86_64 } + let(:guard_architecture) { :x86_64 } it "executes a 64-bit guard", :windows64_only do resource.only_if resource_guard_command, architecture: guard_architecture resource.run_action(:run) @@ -100,7 +100,7 @@ shared_context Chef::Resource::WindowsScript do end context "when the guard's architecture is specified as 32-bit" do - let (:guard_architecture) { :i386 } + let(:guard_architecture) { :i386 } it "executes a 32-bit guard" do resource.only_if resource_guard_command, architecture: guard_architecture resource.run_action(:run) diff --git a/spec/unit/chef_fs/config_spec.rb b/spec/unit/chef_fs/config_spec.rb index 4f112070d8..848e789d3c 100644 --- a/spec/unit/chef_fs/config_spec.rb +++ b/spec/unit/chef_fs/config_spec.rb @@ -203,8 +203,8 @@ describe Chef::ChefFS::Config do }) end - let (:path) { "/roles/foo.json" } - let (:entry) { Entry.new(path) } + let(:path) { "/roles/foo.json" } + let(:entry) { Entry.new(path) } it "returns the entry's path if the cwd isn't in the config" do cfg = Chef::ChefFS::Config.new(config, "/my_repo/cookbooks") diff --git a/spec/unit/guard_interpreter_spec.rb b/spec/unit/guard_interpreter_spec.rb index 85850b14a4..82bdb58483 100644 --- a/spec/unit/guard_interpreter_spec.rb +++ b/spec/unit/guard_interpreter_spec.rb @@ -20,7 +20,7 @@ require "spec_helper" describe Chef::GuardInterpreter do describe "#for_resource" do - let (:resource) { Chef::Resource.new("foo") } + let(:resource) { Chef::Resource.new("foo") } it "returns a DefaultGuardInterpreter if the resource has guard_interpreter set to :default" do resource.guard_interpreter :default diff --git a/spec/unit/http/api_versions_spec.rb b/spec/unit/http/api_versions_spec.rb index af0fd16e5e..774e435c41 100644 --- a/spec/unit/http/api_versions_spec.rb +++ b/spec/unit/http/api_versions_spec.rb @@ -72,7 +72,7 @@ describe Chef::HTTP::APIVersions do end context "with an unacceptable api version" do - let (:return_value) { "406" } + let(:return_value) { "406" } it "resets the list of supported versions" do Chef::ServerAPIVersions.instance.set_versions({ "min_version" => 1, "max_version" => 3 }) run_api_version_handler diff --git a/spec/unit/knife/cookbook_download_spec.rb b/spec/unit/knife/cookbook_download_spec.rb index 78dd20e2d2..2d1d70cb51 100644 --- a/spec/unit/knife/cookbook_download_spec.rb +++ b/spec/unit/knife/cookbook_download_spec.rb @@ -83,7 +83,7 @@ describe Chef::Knife::CookbookDownload do } end - let (:cookbook) do + let(:cookbook) do cb = Chef::CookbookVersion.new("foobar") cb.version = "1.0.0" cb.manifest = manifest_data @@ -91,7 +91,7 @@ describe Chef::Knife::CookbookDownload do end describe "and no version" do - let (:manifest_data) { { all_files: [] } } + let(:manifest_data) { { all_files: [] } } it "should determine which version to download" do expect(@knife).to receive(:determine_version).and_return("1.0.0") expect(File).to receive(:exists?).with("/var/tmp/chef/foobar-1.0.0").and_return(false) diff --git a/spec/unit/knife/cookbook_show_spec.rb b/spec/unit/knife/cookbook_show_spec.rb index 794447c4eb..defc243de3 100644 --- a/spec/unit/knife/cookbook_show_spec.rb +++ b/spec/unit/knife/cookbook_show_spec.rb @@ -27,24 +27,24 @@ describe Chef::Knife::CookbookShow do allow(Chef::CookbookVersion).to receive(:load).and_return(cb) end - let (:knife) do + let(:knife) do knife = Chef::Knife::CookbookShow.new knife.config = {} knife.name_args = [ "cookbook_name" ] knife end - let (:cb) do + let(:cb) do cb = Chef::CookbookVersion.new("cookbook_name") cb.manifest = manifest cb end - let (:rest) { double(Chef::ServerAPI) } + let(:rest) { double(Chef::ServerAPI) } - let (:content) { "Example recipe text" } + let(:content) { "Example recipe text" } - let (:manifest) do + let(:manifest) do { "all_files" => [ { @@ -68,7 +68,7 @@ describe Chef::Knife::CookbookShow do end describe "with 1 argument: versions" do - let (:response) do + let(:response) do { "cookbook_name" => { "url" => "http://url/cookbooks/cookbook_name", diff --git a/spec/unit/knife/data_bag_edit_spec.rb b/spec/unit/knife/data_bag_edit_spec.rb index e09abaea60..6ebcaf4945 100644 --- a/spec/unit/knife/data_bag_edit_spec.rb +++ b/spec/unit/knife/data_bag_edit_spec.rb @@ -95,7 +95,7 @@ describe Chef::Knife::DataBagEdit do let(:is_encrypted?) { true } let(:db) { Chef::DataBagItem.from_hash(enc_raw_hash) } # If the data bag is encrypted, it gets passed to `edit` as a hash. Otherwise, it gets passed as a DataBag - let (:data_to_edit) { raw_hash } + let(:data_to_edit) { raw_hash } before(:each) do expect(knife).to receive(:encryption_secret_provided_ignore_encrypt_flag?).and_return(true) diff --git a/spec/unit/mixin/powershell_type_coercions_spec.rb b/spec/unit/mixin/powershell_type_coercions_spec.rb index 2aafcbac23..7eebfd2348 100644 --- a/spec/unit/mixin/powershell_type_coercions_spec.rb +++ b/spec/unit/mixin/powershell_type_coercions_spec.rb @@ -25,7 +25,7 @@ class Chef::PSTypeTester end describe Chef::Mixin::PowershellTypeCoercions do - let (:test_class) { Chef::PSTypeTester.new } + let(:test_class) { Chef::PSTypeTester.new } describe "#translate_type" do it "single quotes a string" do diff --git a/spec/unit/mixin/subclass_directive_spec.rb b/spec/unit/mixin/subclass_directive_spec.rb index 65e9306e0f..f7732cc51b 100644 --- a/spec/unit/mixin/subclass_directive_spec.rb +++ b/spec/unit/mixin/subclass_directive_spec.rb @@ -31,9 +31,9 @@ class ChildWithoutDirective < SubclassDirectiveParent end describe Chef::Mixin::Uris do - let (:child) { SubclassDirectiveChild.new } + let(:child) { SubclassDirectiveChild.new } - let (:other_child) { ChildWithoutDirective.new } + let(:other_child) { ChildWithoutDirective.new } it "the child instance has the directive set" do expect(child.behave_differently?).to be true diff --git a/spec/unit/mixin/unformatter_spec.rb b/spec/unit/mixin/unformatter_spec.rb index 9498e7f81e..a2fc69000b 100644 --- a/spec/unit/mixin/unformatter_spec.rb +++ b/spec/unit/mixin/unformatter_spec.rb @@ -27,8 +27,8 @@ class Chef::UnformatterTest end describe Chef::Mixin::Unformatter do - let (:unformatter) { Chef::UnformatterTest.new } - let (:message) { "Test Message" } + let(:unformatter) { Chef::UnformatterTest.new } + let(:message) { "Test Message" } describe "#write" do context "with a timestamp" do diff --git a/spec/unit/mixin/uris_spec.rb b/spec/unit/mixin/uris_spec.rb index 567da86899..b8b500cb38 100644 --- a/spec/unit/mixin/uris_spec.rb +++ b/spec/unit/mixin/uris_spec.rb @@ -24,7 +24,7 @@ class Chef::UrisTest end describe Chef::Mixin::Uris do - let (:uris) { Chef::UrisTest.new } + let(:uris) { Chef::UrisTest.new } describe "#uri_scheme?" do it "matches 'scheme://foo.com'" do 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) diff --git a/spec/unit/util/backup_spec.rb b/spec/unit/util/backup_spec.rb index c956b31e4e..1db64d3029 100644 --- a/spec/unit/util/backup_spec.rb +++ b/spec/unit/util/backup_spec.rb @@ -21,7 +21,7 @@ require "tmpdir" describe Chef::Util::Backup do - let (:tempfile) do + let(:tempfile) do Tempfile.new("chef-util-backup-spec-test") end diff --git a/spec/unit/util/powershell/ps_credential_spec.rb b/spec/unit/util/powershell/ps_credential_spec.rb index 1434580f01..73abe41de8 100644 --- a/spec/unit/util/powershell/ps_credential_spec.rb +++ b/spec/unit/util/powershell/ps_credential_spec.rb @@ -20,8 +20,8 @@ require "chef" require "chef/util/powershell/ps_credential" describe Chef::Util::Powershell::PSCredential do - let (:username) { "foo" } - let (:password) { "ThIsIsThEpAsSwOrD" } + let(:username) { "foo" } + let(:password) { "ThIsIsThEpAsSwOrD" } context "when username and password are provided" do let(:ps_credential) { Chef::Util::Powershell::PSCredential.new(username, password) } diff --git a/spec/unit/util/selinux_spec.rb b/spec/unit/util/selinux_spec.rb index 2b73981934..2a4b26b2b6 100644 --- a/spec/unit/util/selinux_spec.rb +++ b/spec/unit/util/selinux_spec.rb @@ -114,7 +114,7 @@ describe Chef::Util::Selinux do end describe "when restorecon binary exists on the system" do - let (:path) { "/path/to/awesome directory" } + let(:path) { "/path/to/awesome directory" } before do @restorecon_enabled_path = File.join("/sbin", "restorecon") |