summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Hain <shain@chef.io>2017-11-22 11:22:59 -0800
committerScott Hain <shain@chef.io>2017-11-22 11:24:04 -0800
commitb89af46f245a79651ea6a7292c2d202b89a67127 (patch)
tree68ac28f8bb1b2283dacbe19f6bfa3bd394b00c47
parent2a77a8bc19eaaacf548b0ae66ee01a693130f5cb (diff)
downloadchef-shain/fix_ifconfig_spec.tar.gz
Fix ifconfig spec to reflect new codeshain/fix_ifconfig_spec
Signed-off-by: Scott Hain <shain@chef.io>
-rw-r--r--spec/unit/provider/ifconfig_spec.rb11
1 files changed, 3 insertions, 8 deletions
diff --git a/spec/unit/provider/ifconfig_spec.rb b/spec/unit/provider/ifconfig_spec.rb
index da27d647ee..06dddf89d6 100644
--- a/spec/unit/provider/ifconfig_spec.rb
+++ b/spec/unit/provider/ifconfig_spec.rb
@@ -42,16 +42,11 @@ describe Chef::Provider::Ifconfig do
end
describe Chef::Provider::Ifconfig, "load_current_resource" do
before do
- @status = double(stdout: "", exitstatus: 1)
- allow(@provider).to receive(:shell_out).and_return(@status)
- @provider.load_current_resource
- end
- it "should track state of ifconfig failure" do
- expect(@provider.instance_variable_get("@status").exitstatus).not_to eq(0)
+ mixlib = Mixlib::ShellOut.new
+ allow(@provider).to receive(:shell_out).and_return(mixlib)
end
it "should thrown an exception when ifconfig fails" do
- @provider.define_resource_requirements
- expect { @provider.process_resource_requirements }.to raise_error Chef::Exceptions::Ifconfig
+ expect { @provider.load_current_resource }.to raise_error
end
end
describe Chef::Provider::Ifconfig, "action_add" do