summaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
authorBryan McLellan <btm@loftninjas.org>2019-05-30 09:17:42 -0400
committerBryan McLellan <btm@loftninjas.org>2019-05-30 09:17:42 -0400
commitc8ddcced6386b66d29aae7248bfaab2b40640cc8 (patch)
treed5d4b3e92127547ade81235462b5916ef78fc2bb /spec/unit
parent5827d6b63034be1f86f7b5afc614a15bde484da0 (diff)
downloadchef-c8ddcced6386b66d29aae7248bfaab2b40640cc8.tar.gz
Raise knife exceptions when verbosity is 3 (-VVV)btm/fix-knife-exceptions
Fixes #8433 When we added trace this check wasn't changed, which means you only saw the stacktrace for 2 (-VV) but not for 3 (-VVV) Signed-off-by: Bryan McLellan <btm@loftninjas.org>
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/knife_spec.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/spec/unit/knife_spec.rb b/spec/unit/knife_spec.rb
index 080b2ffa29..169265c52d 100644
--- a/spec/unit/knife_spec.rb
+++ b/spec/unit/knife_spec.rb
@@ -372,11 +372,14 @@ describe Chef::Knife do
end
end
- it "does not humanize the exception if Chef::Config[:verbosity] is two" do
- Chef::Config[:verbosity] = 2
- allow(knife).to receive(:run).and_raise(Exception)
- expect(knife).not_to receive(:humanize_exception)
- expect { knife.run_with_pretty_exceptions }.to raise_error(Exception)
+ # -VV (2) is debug, -VVV (3) is trace
+ [ 2, 3 ].each do |verbosity|
+ it "does not humanize the exception if Chef::Config[:verbosity] is #{verbosity}" do
+ Chef::Config[:verbosity] = verbosity
+ allow(knife).to receive(:run).and_raise(Exception)
+ expect(knife).not_to receive(:humanize_exception)
+ expect { knife.run_with_pretty_exceptions }.to raise_error(Exception)
+ end
end
end