1
0
Fork 0
forked from gitea/nas

Handle CLI failure exit status at the top-level script (#28322)

This commit is contained in:
Matt Jankowski 2024-01-26 03:53:44 -05:00 committed by GitHub
parent 881e8c113c
commit 0e0a94f483
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 150 additions and 320 deletions

View file

@ -20,8 +20,7 @@ describe Mastodon::CLI::Media do
it 'warns about usage and exits' do
expect { subject }
.to output_results('--prune-profiles and --remove-headers should not be specified simultaneously')
.and raise_error(SystemExit)
.to raise_error(Thor::Error, '--prune-profiles and --remove-headers should not be specified simultaneously')
end
end
@ -30,8 +29,7 @@ describe Mastodon::CLI::Media do
it 'warns about usage and exits' do
expect { subject }
.to output_results('--include-follows can only be used with --prune-profiles or --remove-headers')
.and raise_error(SystemExit)
.to raise_error(Thor::Error, '--include-follows can only be used with --prune-profiles or --remove-headers')
end
end
@ -98,8 +96,7 @@ describe Mastodon::CLI::Media do
it 'warns about url and exits' do
expect { subject }
.to output_results('Not a media URL')
.and raise_error(SystemExit)
.to raise_error(Thor::Error, 'Not a media URL')
end
end
@ -121,8 +118,7 @@ describe Mastodon::CLI::Media do
context 'without any options' do
it 'warns about usage and exits' do
expect { subject }
.to output_results('Specify the source')
.and raise_error(SystemExit)
.to raise_error(Thor::Error, /Specify the source/)
end
end
@ -147,8 +143,7 @@ describe Mastodon::CLI::Media do
it 'warns about usage and exits' do
expect { subject }
.to output_results('No such account')
.and raise_error(SystemExit)
.to raise_error(Thor::Error, 'No such account')
end
end
@ -221,8 +216,7 @@ describe Mastodon::CLI::Media do
it 'warns about usage and exits' do
expect { subject }
.to output_results('azure storage driver is not supported')
.and raise_error(SystemExit)
.to raise_error(Thor::Error, /azure storage driver is not supported/)
end
end
@ -233,8 +227,7 @@ describe Mastodon::CLI::Media do
it 'warns about usage and exits' do
expect { subject }
.to output_results('fog storage driver is not supported')
.and raise_error(SystemExit)
.to raise_error(Thor::Error, /fog storage driver is not supported/)
end
end