Skip to content

Commit ed0f1c1

Browse files
author
Rafael Mendonça França
committed
Fix false positive test code
Since we are rescuing the exception this test would never fail. Now we are sure this test will fail if the code changes.
1 parent e7838f7 commit ed0f1c1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

spec/base_spec.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,12 @@ def hello
246246
describe '#start' do
247247
it 'raises an error instead of rescuing if THOR_DEBUG=1 is given' do
248248
begin
249-
ENV['THOR_DEBUG'] = 1
249+
ENV['THOR_DEBUG'] = '1'
250+
250251
expect do
251252
MyScript.start %w[what --debug]
252-
end.to raise_error(Thor::UndefinedcommandError, 'Could not find command "what" in "my_script" namespace.')
253-
rescue
253+
end.to raise_error(Thor::UndefinedCommandError, 'Could not find command "what" in "my_script" namespace.')
254+
ensure
254255
ENV['THOR_DEBUG'] = nil
255256
end
256257
end

0 commit comments

Comments
 (0)