summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2014-10-20 14:09:12 -0700
committerJay Mundrawala <jdmundrawala@gmail.com>2014-10-22 12:25:48 -0700
commitdf8d6e914999adcb44cf5052afbe276b126181b7 (patch)
tree34ea652ce83e8e3fa5d545b41cf7f0b1d75603ad
parenta2128b7aaa5ad494ea17559cfe3796f2cb2e5e6c (diff)
downloadchef-jdmundrawala/issue-2225.tar.gz
Added spec to test a whatif expception with \r\n is corrrectly classifiedjdmundrawala/issue-2225
-rw-r--r--spec/unit/util/dsc/local_configuration_manager_spec.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/unit/util/dsc/local_configuration_manager_spec.rb b/spec/unit/util/dsc/local_configuration_manager_spec.rb
index f630ac89d8..eb27e9e94e 100644
--- a/spec/unit/util/dsc/local_configuration_manager_spec.rb
+++ b/spec/unit/util/dsc/local_configuration_manager_spec.rb
@@ -32,7 +32,7 @@ EOH
}
let(:no_whatif_lcm_output) { <<-EOH
-Start-DscConfiguration : A parameter cannot be found that matches parameter name 'whatif'.
+Start-DscConfiguration : A parameter cannot be found\r\n that matches parameter name 'whatif'.
At line:1 char:123
+ run-somecommand -whatif
+ ~~~~~~~~
@@ -77,8 +77,13 @@ EOH
let(:lcm_standard_error) { no_whatif_lcm_output }
let(:lcm_cmdlet_success) { false }
+ it 'returns true when passed to #whatif_not_supported?' do
+ expect(lcm.send(:whatif_not_supported?, no_whatif_lcm_output)).to be_true
+ end
+
it 'should should return a (possibly empty) array of ResourceInfo instances' do
expect(Chef::Log).to receive(:warn)
+ expect(lcm).to receive(:whatif_not_supported?).and_call_original
test_configuration_result = nil
expect {test_configuration_result = lcm.test_configuration('config')}.not_to raise_error
expect(test_configuration_result.class).to be(Array)