summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-04-15 17:00:54 -0700
committerTim Smith <tsmith84@gmail.com>2020-04-15 17:02:44 -0700
commit8dd7e3dce2a91c4dcdada2f4adf26f51a4ed2e71 (patch)
tree6781095584c8d0326d849b60c656f78e386e0868
parent4601e0435e539817b1bfbd80e828291ae6e6c2b2 (diff)
downloadchef-8dd7e3dce2a91c4dcdada2f4adf26f51a4ed2e71.tar.gz
Add a spec for the EOL warnings
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--spec/unit/client_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/unit/client_spec.rb b/spec/unit/client_spec.rb
index 37b7f30ad2..d7b58b580f 100644
--- a/spec/unit/client_spec.rb
+++ b/spec/unit/client_spec.rb
@@ -307,6 +307,22 @@ describe Chef::Client do
end
end
+ describe "eol release warning" do
+ it "warns when running an EOL release" do
+ stub_const("Chef::VERSION", 15)
+ allow(Time).to receive(:now).and_return(Time.new("2030-01-01"))
+ expect(logger).to receive(:warn).with(/This release of.*became end of life \(EOL\) on May 1st 2022/)
+ client.warn_if_eol
+ end
+
+ it "does not warn when running an non-EOL release" do
+ stub_const("Chef::VERSION", 15)
+ allow(Time).to receive(:now).and_return(Time.new("2020-01-01"))
+ expect(logger).to_not receive(:warn).with(/became end of life/)
+ client.warn_if_eol
+ end
+ end
+
describe "authentication protocol selection" do
context "when FIPS is disabled" do
before do