diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2014-01-29 14:17:47 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2014-01-29 14:17:47 -0800 |
commit | b19b7d000887209f9d8dc1dc6aa468a0497a7391 (patch) | |
tree | 68d1eb6c136df20c2800f1dddb4e2c1ed5d75a42 /spec/unit/provider/ifconfig | |
parent | b5c9c6afdfd83fe3f1bf4c991daffeff94b49750 (diff) | |
download | chef-b19b7d000887209f9d8dc1dc6aa468a0497a7391.tar.gz |
s/stub!/stub/g
fix deprecation warnings
Diffstat (limited to 'spec/unit/provider/ifconfig')
-rw-r--r-- | spec/unit/provider/ifconfig/aix_spec.rb | 14 | ||||
-rw-r--r-- | spec/unit/provider/ifconfig/debian_spec.rb | 4 | ||||
-rw-r--r-- | spec/unit/provider/ifconfig/redhat_spec.rb | 8 |
3 files changed, 13 insertions, 13 deletions
diff --git a/spec/unit/provider/ifconfig/aix_spec.rb b/spec/unit/provider/ifconfig/aix_spec.rb index 39e9919740..24f5fb18f3 100644 --- a/spec/unit/provider/ifconfig/aix_spec.rb +++ b/spec/unit/provider/ifconfig/aix_spec.rb @@ -67,7 +67,7 @@ IFCONFIG it "should add an interface if it does not exist" do @new_resource.device "en10" - @provider.stub!(:load_current_resource) do + @provider.stub(:load_current_resource) do @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 @@ -81,7 +81,7 @@ IFCONFIG it "should raise exception if metric attribute is set" do @new_resource.device "en0" @new_resource.metric "1" - @provider.stub!(:load_current_resource) do + @provider.stub(:load_current_resource) do @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 @@ -93,7 +93,7 @@ IFCONFIG describe "#action_enable" do it "should enable an interface if it does not exist" do @new_resource.device "en10" - @provider.stub!(:load_current_resource) do + @provider.stub(:load_current_resource) do @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 @@ -109,7 +109,7 @@ IFCONFIG it "should not disable an interface if it does not exist" do @new_resource.device "en10" - @provider.stub!(:load_current_resource) do + @provider.stub(:load_current_resource) do @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 @@ -123,7 +123,7 @@ IFCONFIG context "interface exists" do before do @new_resource.device "en10" - @provider.stub!(:load_current_resource) do + @provider.stub(:load_current_resource) do @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 @@ -146,7 +146,7 @@ IFCONFIG it "should not delete an interface if it does not exist" do @new_resource.device "en10" - @provider.stub!(:load_current_resource) do + @provider.stub(:load_current_resource) do @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 @@ -160,7 +160,7 @@ IFCONFIG context "interface exists" do before do @new_resource.device "en10" - @provider.stub!(:load_current_resource) do + @provider.stub(:load_current_resource) do @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 diff --git a/spec/unit/provider/ifconfig/debian_spec.rb b/spec/unit/provider/ifconfig/debian_spec.rb index 617e840e1f..93504b4096 100644 --- a/spec/unit/provider/ifconfig/debian_spec.rb +++ b/spec/unit/provider/ifconfig/debian_spec.rb @@ -37,8 +37,8 @@ describe Chef::Provider::Ifconfig::Debian do status = mock("Status", :exitstatus => 0) @provider.instance_variable_set("@status", status) @provider.current_resource = @current_resource - @provider.stub!(:load_current_resource) - @provider.stub!(:run_command) + @provider.stub(:load_current_resource) + @provider.stub(:run_command) @config_filename_ifaces = "/etc/network/interfaces" @config_filename_ifcfg = "/etc/network/interfaces.d/ifcfg-#{@new_resource.device}" diff --git a/spec/unit/provider/ifconfig/redhat_spec.rb b/spec/unit/provider/ifconfig/redhat_spec.rb index b6f83ffea9..fc7ace5398 100644 --- a/spec/unit/provider/ifconfig/redhat_spec.rb +++ b/spec/unit/provider/ifconfig/redhat_spec.rb @@ -42,8 +42,8 @@ describe Chef::Provider::Ifconfig::Redhat do describe "generate_config for action_add" do it "should write network-script for centos" do - @provider.stub!(:load_current_resource) - @provider.stub!(:run_command) + @provider.stub(:load_current_resource) + @provider.stub(:run_command) config_filename = "/etc/sysconfig/network-scripts/ifcfg-#{@new_resource.device}" config_file = StringIO.new File.should_receive(:new).with(config_filename, "w").and_return(config_file) @@ -59,8 +59,8 @@ describe Chef::Provider::Ifconfig::Redhat do it "should delete network-script if it exists for centos" do @current_resource.device @new_resource.device - @provider.stub!(:load_current_resource) - @provider.stub!(:run_command) + @provider.stub(:load_current_resource) + @provider.stub(:run_command) config_filename = "/etc/sysconfig/network-scripts/ifcfg-#{@new_resource.device}" File.should_receive(:exist?).with(config_filename).and_return(true) FileUtils.should_receive(:rm_f).with(config_filename, :verbose => false) |