diff options
author | kaustubh-d <kausubh@clogeny.com> | 2013-07-18 03:07:33 -0700 |
---|---|---|
committer | adamedx <adamed@opscode.com> | 2013-07-23 10:36:15 -0700 |
commit | 6d438308777d2b3d67b71dc27a550c7b6ecb6d5b (patch) | |
tree | 3082eb3e985d53a811ada3a1b04098175ff3c3db | |
parent | 18f4c43028f5ef51831488668c4227a2fd128a7c (diff) | |
download | chef-6d438308777d2b3d67b71dc27a550c7b6ecb6d5b.tar.gz |
aix ifconfig - validate exception if metric is set.
-rw-r--r-- | spec/unit/provider/ifconfig/aix_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/unit/provider/ifconfig/aix_spec.rb b/spec/unit/provider/ifconfig/aix_spec.rb index 0408d00388..b8755e2bed 100644 --- a/spec/unit/provider/ifconfig/aix_spec.rb +++ b/spec/unit/provider/ifconfig/aix_spec.rb @@ -78,6 +78,18 @@ IFCONFIG @new_resource.should be_updated end + 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.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.run_action(:add)}.to raise_error(Chef::Exceptions::Ifconfig, "interface metric attribute cannot be set for :add action") + end + + context "VIP" do before do @provider.stub!(:load_current_resource) do |