summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Higgins <pete@peterhiggins.org>2020-06-05 11:32:08 -0700
committerPete Higgins <pete@peterhiggins.org>2020-06-05 11:32:08 -0700
commitc6fd63bda42c07dc33684240246e42fb31e0bb86 (patch)
tree1a7636d0f7bcdcdb415082b6ef4d4506cc6316dd
parent48f9d3aee21a3f1a24ebef4666c0117086cb10f8 (diff)
downloadchef-c6fd63bda42c07dc33684240246e42fb31e0bb86.tar.gz
Fix wrong unit test exposed by cleaning up rspec deprecations.
Signed-off-by: Pete Higgins <pete@peterhiggins.org>
-rw-r--r--spec/unit/mixin/user_context_spec.rb10
1 files changed, 1 insertions, 9 deletions
diff --git a/spec/unit/mixin/user_context_spec.rb b/spec/unit/mixin/user_context_spec.rb
index d00bb51f78..2431c4b881 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