summaryrefslogtreecommitdiff
path: root/spec/unit/application/solo_spec.rb
diff options
context:
space:
mode:
authorClaire McQuin <claire@getchef.com>2014-09-22 15:31:47 -0700
committerClaire McQuin <claire@getchef.com>2014-10-01 14:31:05 -0700
commit97b628a766d14a6a8fe6b3b2febb604a570e0cde (patch)
tree29f7f11b43250010a8e71c787c8d01eae0f1b97a /spec/unit/application/solo_spec.rb
parent00ecc94e206da3c09cf5dac8d698deaba970d8b2 (diff)
downloadchef-97b628a766d14a6a8fe6b3b2febb604a570e0cde.tar.gz
Disable unforked interval runs.
Clarify error message. Move fork and interval logic to application (specs pending). Clean code logic, fix specs. Allow unforked client runs with daemonize or splay
Diffstat (limited to 'spec/unit/application/solo_spec.rb')
-rw-r--r--spec/unit/application/solo_spec.rb26
1 files changed, 25 insertions, 1 deletions
diff --git a/spec/unit/application/solo_spec.rb b/spec/unit/application/solo_spec.rb
index 787f9ff43c..e29fcc9367 100644
--- a/spec/unit/application/solo_spec.rb
+++ b/spec/unit/application/solo_spec.rb
@@ -36,6 +36,31 @@ describe Chef::Application::Solo do
Chef::Config[:solo].should be_true
end
+ describe "when configured to not fork the client process" do
+ before do
+ Chef::Config[:client_fork] = false
+ Chef::Config[:daemonize] = false
+ Chef::Config[:interval] = nil
+ Chef::Config[:splay] = nil
+ end
+
+ context "when interval is given" do
+ before do
+ Chef::Config[:interval] = 600
+ end
+
+ it "should terminate with message" do
+ Chef::Application.should_receive(:fatal!).with(
+"Unforked chef-client interval runs are disabled in Chef 12.
+Configuration settings:
+ interval = 600 seconds
+Enable chef-client interval runs by setting `:client_fork = true` in your config file or adding `--fork` to your command line options."
+ )
+ @app.reconfigure
+ end
+ end
+ end
+
describe "when in daemonized mode and no interval has been set" do
before do
Chef::Config[:daemonize] = true
@@ -142,4 +167,3 @@ describe Chef::Application::Solo do
end
end
-