summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-06-08 09:33:36 -0700
committerGitHub <noreply@github.com>2020-06-08 09:33:36 -0700
commitbed16ddf827934c897635855d1d3ee35900e6541 (patch)
tree4d9691a521dfa636d9d5bd015955199dd4544240
parent48f9d3aee21a3f1a24ebef4666c0117086cb10f8 (diff)
parent177fa21124e92d109d63ca1daadc0097097e9a6b (diff)
downloadchef-bed16ddf827934c897635855d1d3ee35900e6541.tar.gz
Merge pull request #9961 from chef/fix-wrong-unit-test
Fix wrong unit test exposed by cleaning up rspec deprecations.
-rw-r--r--lib/chef/resource/chef_client_scheduled_task.rb2
-rw-r--r--spec/unit/mixin/user_context_spec.rb10
2 files changed, 2 insertions, 10 deletions
diff --git a/lib/chef/resource/chef_client_scheduled_task.rb b/lib/chef/resource/chef_client_scheduled_task.rb
index cdbf6420ac..f730c12ef1 100644
--- a/lib/chef/resource/chef_client_scheduled_task.rb
+++ b/lib/chef/resource/chef_client_scheduled_task.rb
@@ -82,7 +82,7 @@ class Chef
coerce: proc { |x| Integer(x) },
callbacks: { "should be a positive number" => proc { |v| v > 0 } },
description: "Numeric value to go with the scheduled task frequency",
- default: lazy { frequency == "minute" ? 30 : 1 },
+ default: lazy { frequency == "minute" ? 30 : 1 },
default_description: "30 if frequency is 'minute', 1 otherwise"
property :accept_chef_license, [true, false],
diff --git a/spec/unit/mixin/user_context_spec.rb b/spec/unit/mixin/user_context_spec.rb
index d00bb51f78..6c2ea298ae 100644
--- a/spec/unit/mixin/user_context_spec.rb
+++ b/spec/unit/mixin/user_context_spec.rb
@@ -77,17 +77,9 @@ describe "a class that mixes in user_context" do
end
context "when the block raises an exception" do
- class UserContextTestException < RuntimeError
- end
- let(:block_parameter) { Proc.new { raise UserContextTextException } }
-
- it "raises the exception raised by the block" do
- expect { instance_with_user_context.with_context("kamilah", nil, "chef4life", &block_parameter) }.not_to raise_error
- end
-
it "closes the logon session so resources are not leaked" do
expect(logon_session).to receive(:close)
- expect { instance_with_user_context.with_context("kamilah", nil, "chef4life", &block_parameter) }.not_to raise_error
+ expect { instance_with_user_context.with_context("kamilah", nil, "chef4life") { 1 / 0 } }.to raise_error(ZeroDivisionError)
end
end
end