diff options
Diffstat (limited to 'spec/unit/util')
-rw-r--r-- | spec/unit/util/diff_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/util/dsc/configuration_generator_spec.rb | 8 | ||||
-rw-r--r-- | spec/unit/util/dsc/local_configuration_manager_spec.rb | 4 | ||||
-rw-r--r-- | spec/unit/util/powershell/cmdlet_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/util/selinux_spec.rb | 12 |
5 files changed, 14 insertions, 14 deletions
diff --git a/spec/unit/util/diff_spec.rb b/spec/unit/util/diff_spec.rb index 4bb0abd087..70376bcdb1 100644 --- a/spec/unit/util/diff_spec.rb +++ b/spec/unit/util/diff_spec.rb @@ -546,7 +546,7 @@ shared_examples_for "a diff util" do end -describe Chef::Util::Diff, :uses_diff => true do +describe Chef::Util::Diff, uses_diff: true do let!(:old_file) { old_tempfile.path } let!(:new_file) { new_tempfile.path } diff --git a/spec/unit/util/dsc/configuration_generator_spec.rb b/spec/unit/util/dsc/configuration_generator_spec.rb index cfa7a4e264..faf554326d 100644 --- a/spec/unit/util/dsc/configuration_generator_spec.rb +++ b/spec/unit/util/dsc/configuration_generator_spec.rb @@ -76,7 +76,7 @@ describe Chef::Util::DSC::ConfigurationGenerator do context "when symbols are used as switches" do it "should merge the hash if there are no restricted switches" do - merged = conf_man.send(:get_merged_configuration_flags!, { :flag => "a" }, "hello") + merged = conf_man.send(:get_merged_configuration_flags!, { flag: "a" }, "hello") expect(merged).to include(:flag) expect(merged[:flag]).to eql("a") expect(merged).to include(:outputpath) @@ -84,18 +84,18 @@ describe Chef::Util::DSC::ConfigurationGenerator do it "should raise an ArgumentError if you try to override outputpath" do expect do - conf_man.send(:get_merged_configuration_flags!, { :outputpath => "a" }, "hello") + conf_man.send(:get_merged_configuration_flags!, { outputpath: "a" }, "hello") end.to raise_error(ArgumentError) end it "should be case insensitive for switches that are not allowed" do expect do - conf_man.send(:get_merged_configuration_flags!, { :OutputPath => "a" }, "hello") + conf_man.send(:get_merged_configuration_flags!, { OutputPath: "a" }, "hello") end.to raise_error(ArgumentError) end it "should be case insensitive to switches that are allowed" do - merged = conf_man.send(:get_merged_configuration_flags!, { :FLAG => "a" }, "hello") + merged = conf_man.send(:get_merged_configuration_flags!, { FLAG: "a" }, "hello") expect(merged).to include(:flag) end end diff --git a/spec/unit/util/dsc/local_configuration_manager_spec.rb b/spec/unit/util/dsc/local_configuration_manager_spec.rb index 4c33fc8616..33c618f2eb 100644 --- a/spec/unit/util/dsc/local_configuration_manager_spec.rb +++ b/spec/unit/util/dsc/local_configuration_manager_spec.rb @@ -50,7 +50,7 @@ EOH end let(:lcm_status) do - double("LCM cmdlet status", :stderr => lcm_standard_error, :return_value => lcm_standard_output, :succeeded? => lcm_cmdlet_success) + double("LCM cmdlet status", stderr: lcm_standard_error, return_value: lcm_standard_output, succeeded?: lcm_cmdlet_success) end describe "test_configuration method invocation" do @@ -192,7 +192,7 @@ EOH context "when invalid dsc script is given" do it "raises exception" do configuration_document = "invalid-config" - shellout_flags = { :cwd => nil, :environment => nil, :timeout => nil } + shellout_flags = { cwd: nil, environment: nil, timeout: nil } expect { lcm.send(:run_configuration_cmdlet, configuration_document, true, shellout_flags) }.to raise_error(Chef::Exceptions::PowershellCmdletException) end end diff --git a/spec/unit/util/powershell/cmdlet_spec.rb b/spec/unit/util/powershell/cmdlet_spec.rb index 800e4cc9c0..144e363979 100644 --- a/spec/unit/util/powershell/cmdlet_spec.rb +++ b/spec/unit/util/powershell/cmdlet_spec.rb @@ -75,7 +75,7 @@ describe Chef::Util::Powershell::Cmdlet do it "does not allow invalid switch names" do expect do - @cmdlet.send(:command_switches_string, { :foo! => "bar" }) + @cmdlet.send(:command_switches_string, { foo!: "bar" }) end.to raise_error(ArgumentError) end diff --git a/spec/unit/util/selinux_spec.rb b/spec/unit/util/selinux_spec.rb index 8da6492fae..0d2d1aeb3f 100644 --- a/spec/unit/util/selinux_spec.rb +++ b/spec/unit/util/selinux_spec.rb @@ -60,8 +60,8 @@ describe Chef::Util::Selinux do describe "when selinux is enabled" do before do - cmd_result = double("Cmd Result", :exitstatus => 0) - expect(@test_instance).to receive(:shell_out!).once.with(@selinux_enabled_path, { :returns => [0, 1] }).and_return(cmd_result) + cmd_result = double("Cmd Result", exitstatus: 0) + expect(@test_instance).to receive(:shell_out!).once.with(@selinux_enabled_path, { returns: [0, 1] }).and_return(cmd_result) end it "should report selinux is enabled" do @@ -73,8 +73,8 @@ describe Chef::Util::Selinux do describe "when selinux is disabled" do before do - cmd_result = double("Cmd Result", :exitstatus => 1) - expect(@test_instance).to receive(:shell_out!).once.with(@selinux_enabled_path, { :returns => [0, 1] }).and_return(cmd_result) + cmd_result = double("Cmd Result", exitstatus: 1) + expect(@test_instance).to receive(:shell_out!).once.with(@selinux_enabled_path, { returns: [0, 1] }).and_return(cmd_result) end it "should report selinux is disabled" do @@ -86,8 +86,8 @@ describe Chef::Util::Selinux do describe "when selinux gives an unexpected status" do before do - cmd_result = double("Cmd Result", :exitstatus => 101) - expect(@test_instance).to receive(:shell_out!).once.with(@selinux_enabled_path, { :returns => [0, 1] }).and_return(cmd_result) + cmd_result = double("Cmd Result", exitstatus: 101) + expect(@test_instance).to receive(:shell_out!).once.with(@selinux_enabled_path, { returns: [0, 1] }).and_return(cmd_result) end it "should throw an error" do |