summaryrefslogtreecommitdiff
path: root/spec/unit/application
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-08-27 15:20:44 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2019-08-28 10:53:34 -0700
commit72562e52a3fdc325f1bfe12d42f75a12a8c7307d (patch)
tree5568278a6d481e11d336e7746dde1815445c3428 /spec/unit/application
parentdd0009d7e77f192cadb1632f2159a6dbc880980f (diff)
downloadchef-72562e52a3fdc325f1bfe12d42f75a12a8c7307d.tar.gz
fail on interval runs on windows
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/unit/application')
-rw-r--r--spec/unit/application/client_spec.rb11
-rw-r--r--spec/unit/application/solo_spec.rb11
2 files changed, 8 insertions, 14 deletions
diff --git a/spec/unit/application/client_spec.rb b/spec/unit/application/client_spec.rb
index 0773fc70fd..d4ed403197 100644
--- a/spec/unit/application/client_spec.rb
+++ b/spec/unit/application/client_spec.rb
@@ -1,6 +1,6 @@
# Author:: AJ Christensen (<aj@junglist.gen.nz>)
-# Copyright:: Copyright 2008-2018, Chef Software Inc.
+# Copyright:: Copyright 2008-2019, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -85,7 +85,6 @@ describe Chef::Application::Client, "reconfigure" do
allow(app).to receive(:trap)
allow(app).to receive(:configure_logging).and_return(true)
- Chef::Config[:interval] = 10
Chef::Config[:once] = false
@@ -162,7 +161,7 @@ describe Chef::Application::Client, "reconfigure" do
it_behaves_like "sets the configuration", "--no-fork", client_fork: false
end
- context "with an interval" do
+ context "with an interval", :unix_only do
it_behaves_like "sets the configuration", "--interval 1800", client_fork: true
end
@@ -322,7 +321,7 @@ describe Chef::Application::Client, "reconfigure" do
Chef::Config[:splay] = nil
end
- it "should terminal with message when interval is given" do
+ it "should terminate with message when interval is given" do
Chef::Config[:interval] = 600
allow(ChefConfig).to receive(:windows?).and_return(false)
expect(Chef::Application).to receive(:fatal!).with(
@@ -340,8 +339,8 @@ Enable .* interval runs by setting `:client_fork = true` in your config file or
allow(ChefConfig).to receive(:windows?).and_return(true)
end
- it "should not terminate" do
- expect(Chef::Application).not_to receive(:fatal!)
+ it "should terminate" do
+ expect(Chef::Application).to receive(:fatal!)
app.reconfigure
end
end
diff --git a/spec/unit/application/solo_spec.rb b/spec/unit/application/solo_spec.rb
index 3f540d24e2..e701ff190c 100644
--- a/spec/unit/application/solo_spec.rb
+++ b/spec/unit/application/solo_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: AJ Christensen (<aj@junglist.gen.nz>)
-# Copyright:: Copyright 2008-2018, Chef Software Inc.
+# Copyright:: Copyright 2008-2019, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -64,18 +64,13 @@ describe Chef::Application::Solo do
end
it "should terminate with message" do
- expect(Chef::Application).to receive(:fatal!).with(
- /Unforked .* interval runs are disabled by default\.
-Configuration settings:
- interval = 600 seconds
-Enable .* interval runs by setting `:client_fork = true` in your config file or adding `--fork` to your command line options\./
- )
+ expect(Chef::Application).to receive(:fatal!).with(/interval runs are disabled/)
app.reconfigure
end
end
end
- describe "when in daemonized mode and no interval has been set" do
+ describe "when in daemonized mode and no interval has been set", :unix_only do
before do
Chef::Config[:daemonize] = true
end