Handle CLI failure exit status at the top-level script (#28322)
This commit is contained in:
parent
881e8c113c
commit
0e0a94f483
27 changed files with 150 additions and 320 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue