diff options
Diffstat (limited to 'spec/unit')
-rw-r--r-- | spec/unit/application/client_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/application/solo_spec.rb | 24 |
2 files changed, 17 insertions, 9 deletions
diff --git a/spec/unit/application/client_spec.rb b/spec/unit/application/client_spec.rb index f971848c5b..628d21f58d 100644 --- a/spec/unit/application/client_spec.rb +++ b/spec/unit/application/client_spec.rb @@ -326,7 +326,7 @@ describe Chef::Application::Client, "reconfigure" do Chef::Config[:interval] = 600 allow(ChefConfig).to receive(:windows?).and_return(false) expect(Chef::Application).to receive(:fatal!).with( - "Unforked chef-client interval runs are disabled in Chef 12. + "Unforked chef-client interval runs are only supported on Windows.. 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." diff --git a/spec/unit/application/solo_spec.rb b/spec/unit/application/solo_spec.rb index 939300b7e4..ec49f668b4 100644 --- a/spec/unit/application/solo_spec.rb +++ b/spec/unit/application/solo_spec.rb @@ -57,18 +57,26 @@ describe Chef::Application::Solo do Chef::Config[:splay] = nil end - context "when interval is given" do + it "should terminal 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( + "Unforked chef-client interval runs are only supported on Windows. +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 + + context "when interval is given on windows" do before do Chef::Config[:interval] = 600 + allow(ChefConfig).to receive(:windows?).and_return(true) end - it "should terminate with message" do - expect(Chef::Application).to 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." - ) + it "should not terminate" do + expect(Chef::Application).not_to receive(:fatal!) app.reconfigure end end |