diff options
Diffstat (limited to 'spec/unit/provider/ifconfig/aix_spec.rb')
-rw-r--r-- | spec/unit/provider/ifconfig/aix_spec.rb | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/spec/unit/provider/ifconfig/aix_spec.rb b/spec/unit/provider/ifconfig/aix_spec.rb index 7847fc9a5f..7f316c952b 100644 --- a/spec/unit/provider/ifconfig/aix_spec.rb +++ b/spec/unit/provider/ifconfig/aix_spec.rb @@ -48,7 +48,7 @@ IFCONFIG describe "#load_current_resource" do before do - @status = double(:stdout => @ifconfig_output, :exitstatus => 0) + @status = double(stdout: @ifconfig_output, exitstatus: 0) allow(@provider).to receive(:shell_out).and_return(@status) @new_resource.device "en0" end @@ -68,11 +68,11 @@ IFCONFIG it "should add an interface if it does not exist" do @new_resource.device "en10" allow(@provider).to receive(:load_current_resource) do - @provider.instance_variable_set("@status", double("Status", :exitstatus => 0)) + @provider.instance_variable_set("@status", double("Status", exitstatus: 0)) @provider.instance_variable_set("@current_resource", Chef::Resource::Ifconfig.new("10.0.0.1", @run_context)) end command = "chdev -l #{@new_resource.device} -a netaddr=#{@new_resource.name}" - expect(@provider).to receive(:run_command).with(:command => command) + expect(@provider).to receive(:shell_out!).with(*command.split(" ")) @provider.run_action(:add) expect(@new_resource).to be_updated @@ -82,7 +82,7 @@ IFCONFIG @new_resource.device "en0" @new_resource.metric "1" allow(@provider).to receive(:load_current_resource) do - @provider.instance_variable_set("@status", double("Status", :exitstatus => 0)) + @provider.instance_variable_set("@status", double("Status", exitstatus: 0)) @provider.instance_variable_set("@current_resource", Chef::Resource::Ifconfig.new("10.0.0.1", @run_context)) end @@ -94,11 +94,11 @@ IFCONFIG it "should enable an interface if it does not exist" do @new_resource.device "en10" allow(@provider).to receive(:load_current_resource) do - @provider.instance_variable_set("@status", double("Status", :exitstatus => 0)) + @provider.instance_variable_set("@status", double("Status", exitstatus: 0)) @provider.instance_variable_set("@current_resource", Chef::Resource::Ifconfig.new("10.0.0.1", @run_context)) end command = "ifconfig #{@new_resource.device} #{@new_resource.name}" - expect(@provider).to receive(:run_command).with(:command => command) + expect(@provider).to receive(:shell_out!).with(*command.split(" ")) @provider.run_action(:enable) expect(@new_resource).to be_updated @@ -110,11 +110,11 @@ IFCONFIG it "should not disable an interface if it does not exist" do @new_resource.device "en10" allow(@provider).to receive(:load_current_resource) do - @provider.instance_variable_set("@status", double("Status", :exitstatus => 0)) + @provider.instance_variable_set("@status", double("Status", exitstatus: 0)) @provider.instance_variable_set("@current_resource", Chef::Resource::Ifconfig.new("10.0.0.1", @run_context)) end - expect(@provider).not_to receive(:run_command) + expect(@provider).not_to receive(:shell_out!) @provider.run_action(:disable) expect(@new_resource).not_to be_updated @@ -124,7 +124,7 @@ IFCONFIG before do @new_resource.device "en10" allow(@provider).to receive(:load_current_resource) do - @provider.instance_variable_set("@status", double("Status", :exitstatus => 0)) + @provider.instance_variable_set("@status", double("Status", exitstatus: 0)) current_resource = Chef::Resource::Ifconfig.new("10.0.0.1", @run_context) current_resource.device @new_resource.device @provider.instance_variable_set("@current_resource", current_resource) @@ -133,7 +133,7 @@ IFCONFIG it "should disable an interface if it exists" do command = "ifconfig #{@new_resource.device} down" - expect(@provider).to receive(:run_command).with(:command => command) + expect(@provider).to receive(:shell_out!).with(*command.split(" ")) @provider.run_action(:disable) expect(@new_resource).to be_updated @@ -147,11 +147,11 @@ IFCONFIG it "should not delete an interface if it does not exist" do @new_resource.device "en10" allow(@provider).to receive(:load_current_resource) do - @provider.instance_variable_set("@status", double("Status", :exitstatus => 0)) + @provider.instance_variable_set("@status", double("Status", exitstatus: 0)) @provider.instance_variable_set("@current_resource", Chef::Resource::Ifconfig.new("10.0.0.1", @run_context)) end - expect(@provider).not_to receive(:run_command) + expect(@provider).not_to receive(:shell_out!) @provider.run_action(:delete) expect(@new_resource).not_to be_updated @@ -161,7 +161,7 @@ IFCONFIG before do @new_resource.device "en10" allow(@provider).to receive(:load_current_resource) do - @provider.instance_variable_set("@status", double("Status", :exitstatus => 0)) + @provider.instance_variable_set("@status", double("Status", exitstatus: 0)) current_resource = Chef::Resource::Ifconfig.new("10.0.0.1", @run_context) current_resource.device @new_resource.device @provider.instance_variable_set("@current_resource", current_resource) @@ -170,7 +170,7 @@ IFCONFIG it "should delete an interface if it exists" do command = "chdev -l #{@new_resource.device} -a state=down" - expect(@provider).to receive(:run_command).with(:command => command) + expect(@provider).to receive(:shell_out!).with(*command.split(" ")) @provider.run_action(:delete) expect(@new_resource).to be_updated |