summaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2017-02-26 16:05:26 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2017-02-28 11:19:49 -0800
commit8f2cdc75307dfba5d3867d0794dc6085795dc36f (patch)
tree94a1be6ab8507ba7a0e701b805e2d8539ec27c92 /spec/unit
parent80547d21f52630d65a321975a6b9d19d9f2f49f4 (diff)
downloadchef-8f2cdc75307dfba5d3867d0794dc6085795dc36f.tar.gz
Chef-13: relative creates paths in the execute resource requires a cwd
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/provider/execute_spec.rb16
1 files changed, 3 insertions, 13 deletions
diff --git a/spec/unit/provider/execute_spec.rb b/spec/unit/provider/execute_spec.rb
index 1901e2ea03..904a2841c5 100644
--- a/spec/unit/provider/execute_spec.rb
+++ b/spec/unit/provider/execute_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Prajakta Purohit (<prajakta@chef.io>)
-# Copyright:: Copyright 2008-2016, Chef Software Inc.
+# Copyright:: Copyright 2008-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -118,19 +118,9 @@ describe Chef::Provider::Execute do
new_resource.creates "foo_resource"
end
- it "should warn in Chef-12", chef: "< 13" do
- expect(Chef::Log).to receive(:warn).with(/relative path/)
- expect(FileTest).to receive(:exist?).with(new_resource.creates).and_return(true)
+ it "should raise if user specified relative path without cwd for Chef-13" do
expect(provider).not_to receive(:shell_out!)
- provider.run_action(:run)
- expect(new_resource).not_to be_updated
- end
-
- it "should raise if user specified relative path without cwd for Chef-13", chef: ">= 13" do
- expect(Chef::Log).to receive(:warn).with(/relative path/)
- expect(FileTest).to receive(:exist?).with(new_resource.creates).and_return(true)
- expect(provider).not_to receive(:shell_out!)
- expect { provider.run_action(:run) }.to raise_error # @todo: add a real error for Chef-13
+ expect { provider.run_action(:run) }.to raise_error(Chef::Exceptions::Execute)
end
end