summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorNimishaS <nimisha.sharad@msystechnologies.com>2016-09-23 09:59:51 +0000
committerNimishaS <nimisha.sharad@msystechnologies.com>2016-09-30 12:22:45 +0530
commit5536af82e9d6e825d988ce769bc42a61cfefcb32 (patch)
tree7749cbca5e7cc65cd59e0e7c9cb71d1f071d13a9 /spec
parent4f738f8aaf0fb6f1ee0f24a123640d5abf57a800 (diff)
downloadchef-5536af82e9d6e825d988ce769bc42a61cfefcb32.tar.gz
set erroraction stop instead of continue
Signed-off-by: NimishaS <nimisha.sharad@msystechnologies.com>
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/util/dsc/local_configuration_manager_spec.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/spec/unit/util/dsc/local_configuration_manager_spec.rb b/spec/unit/util/dsc/local_configuration_manager_spec.rb
index 45fe8df40d..3f1210dbf1 100644
--- a/spec/unit/util/dsc/local_configuration_manager_spec.rb
+++ b/spec/unit/util/dsc/local_configuration_manager_spec.rb
@@ -59,10 +59,6 @@ EOH
allow(lcm).to receive(:run_configuration_cmdlet).and_return(lcm_status)
end
context "that returns successfully" do
- before(:each) do
- allow(lcm).to receive(:run_configuration_cmdlet).and_return(lcm_status)
- end
-
let(:lcm_standard_output) { normal_lcm_output }
let(:lcm_standard_error) { nil }
let(:lcm_cmdlet_success) { true }
@@ -138,4 +134,14 @@ EOH
expect(lcm.send(:dsc_module_import_failure?, dsc_resource_import_failure_output.gsub("CimException", "ArgumentException"))).to be(false)
end
end
+
+ describe "#run_configuration_cmdlet" do
+ context "when invalid dsc script is given" do
+ it "raises exception" do
+ configuration_document = "invalid-config"
+ shellout_flags = { :cwd => nil, :environment => nil, :timeout => nil }
+ expect { lcm.send(:run_configuration_cmdlet, configuration_document, true, shellout_flags) }.to raise_error(Chef::Exceptions::PowershellCmdletException)
+ end
+ end
+ end
end