summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan McLellan <btm@loftninjas.org>2017-11-22 13:25:18 -0500
committerBryan McLellan <btm@loftninjas.org>2017-11-22 13:25:18 -0500
commit3ea373c3410a0b7874b9f2317d88c695368ed3b3 (patch)
tree4726bf0159a41b961303ceb12935cdfc5265ce37
parent7430c834fb1a95a724d14da528b75a7e07dfe6ca (diff)
downloadchef-btm/appveyor-bundler.tar.gz
Stub out call to 'ifconfig --version' in unit testsbtm/appveyor-bundler
A recent change to the ifconfig provider added a new shellout call without a corresponding stub added to the unit tests. Signed-off-by: Bryan McLellan <btm@loftninjas.org>
-rw-r--r--spec/unit/provider/ifconfig_spec.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/spec/unit/provider/ifconfig_spec.rb b/spec/unit/provider/ifconfig_spec.rb
index da27d647ee..3732d75cc9 100644
--- a/spec/unit/provider/ifconfig_spec.rb
+++ b/spec/unit/provider/ifconfig_spec.rb
@@ -38,12 +38,19 @@ describe Chef::Provider::Ifconfig do
status = double("Status", exitstatus: 0)
@provider.instance_variable_set("@status", status)
@provider.current_resource = @current_resource
-
end
+
describe Chef::Provider::Ifconfig, "load_current_resource" do
+ let(:net_tools_version) { StringIO.new <<-EOS }
+net-tools 1.60
+ifconfig 1.42 (2001-04-13)
+EOS
+
before do
- @status = double(stdout: "", exitstatus: 1)
- allow(@provider).to receive(:shell_out).and_return(@status)
+ ifconfig = double(stdout: "", exitstatus: 1)
+ allow(@provider).to receive(:shell_out).and_return(ifconfig)
+ ifconfig_version = double(stdout: "", stderr: net_tools_version, exitstatus: 4)
+ allow(@provider).to receive(:shell_out).with("ifconfig --version").and_return(ifconfig_version)
@provider.load_current_resource
end
it "should track state of ifconfig failure" do