Merge remote-tracking branch 'parent/main' into upstream-20240201
This commit is contained in:
commit
92ef42d697
179 changed files with 1218 additions and 2902 deletions
|
@ -46,22 +46,13 @@ RSpec.describe LinkDetailsExtractor do
|
|||
</html>
|
||||
HTML
|
||||
|
||||
describe '#title' do
|
||||
it 'returns the title from title tag' do
|
||||
expect(subject.title).to eq 'Man bites dog'
|
||||
end
|
||||
end
|
||||
|
||||
describe '#description' do
|
||||
it 'returns the description from meta tag' do
|
||||
expect(subject.description).to eq "A dog's tale"
|
||||
end
|
||||
end
|
||||
|
||||
describe '#language' do
|
||||
it 'returns the language from lang attribute' do
|
||||
expect(subject.language).to eq 'en'
|
||||
end
|
||||
it 'extracts the expected values from html metadata' do
|
||||
expect(subject)
|
||||
.to have_attributes(
|
||||
title: eq('Man bites dog'),
|
||||
description: eq("A dog's tale"),
|
||||
language: eq('en')
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -90,40 +81,16 @@ RSpec.describe LinkDetailsExtractor do
|
|||
end
|
||||
|
||||
shared_examples 'structured data' do
|
||||
describe '#title' do
|
||||
it 'returns the title from structured data' do
|
||||
expect(subject.title).to eq 'Man bites dog'
|
||||
end
|
||||
end
|
||||
|
||||
describe '#description' do
|
||||
it 'returns the description from structured data' do
|
||||
expect(subject.description).to eq "A dog's tale"
|
||||
end
|
||||
end
|
||||
|
||||
describe '#published_at' do
|
||||
it 'returns the publicaton time from structured data' do
|
||||
expect(subject.published_at).to eq '2022-01-31T19:53:00+00:00'
|
||||
end
|
||||
end
|
||||
|
||||
describe '#author_name' do
|
||||
it 'returns the author name from structured data' do
|
||||
expect(subject.author_name).to eq 'Charlie Brown'
|
||||
end
|
||||
end
|
||||
|
||||
describe '#provider_name' do
|
||||
it 'returns the provider name from structured data' do
|
||||
expect(subject.provider_name).to eq 'Pet News'
|
||||
end
|
||||
end
|
||||
|
||||
describe '#language' do
|
||||
it 'returns the language from structured data' do
|
||||
expect(subject.language).to eq 'en'
|
||||
end
|
||||
it 'extracts the expected values from structured data' do
|
||||
expect(subject)
|
||||
.to have_attributes(
|
||||
title: eq('Man bites dog'),
|
||||
description: eq("A dog's tale"),
|
||||
published_at: eq('2022-01-31T19:53:00+00:00'),
|
||||
author_name: eq('Charlie Brown'),
|
||||
provider_name: eq('Pet News'),
|
||||
language: eq('en')
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -245,58 +212,19 @@ RSpec.describe LinkDetailsExtractor do
|
|||
</html>
|
||||
HTML
|
||||
|
||||
describe '#canonical_url' do
|
||||
it 'returns the URL from Open Graph protocol data' do
|
||||
expect(subject.canonical_url).to eq 'https://example.com/dog.html'
|
||||
end
|
||||
end
|
||||
|
||||
describe '#title' do
|
||||
it 'returns the title from Open Graph protocol data' do
|
||||
expect(subject.title).to eq 'Man bites dog'
|
||||
end
|
||||
end
|
||||
|
||||
describe '#description' do
|
||||
it 'returns the description from Open Graph protocol data' do
|
||||
expect(subject.description).to eq "A dog's tale"
|
||||
end
|
||||
end
|
||||
|
||||
describe '#published_at' do
|
||||
it 'returns the publicaton time from Open Graph protocol data' do
|
||||
expect(subject.published_at).to eq '2022-01-31T19:53:00+00:00'
|
||||
end
|
||||
end
|
||||
|
||||
describe '#author_name' do
|
||||
it 'returns the author name from Open Graph protocol data' do
|
||||
expect(subject.author_name).to eq 'Charlie Brown'
|
||||
end
|
||||
end
|
||||
|
||||
describe '#language' do
|
||||
it 'returns the language from Open Graph protocol data' do
|
||||
expect(subject.language).to eq 'en'
|
||||
end
|
||||
end
|
||||
|
||||
describe '#image' do
|
||||
it 'returns the image from Open Graph protocol data' do
|
||||
expect(subject.image).to eq 'https://example.com/snoopy.jpg'
|
||||
end
|
||||
end
|
||||
|
||||
describe '#image:alt' do
|
||||
it 'returns the image description from Open Graph protocol data' do
|
||||
expect(subject.image_alt).to eq 'A good boy'
|
||||
end
|
||||
end
|
||||
|
||||
describe '#provider_name' do
|
||||
it 'returns the provider name from Open Graph protocol data' do
|
||||
expect(subject.provider_name).to eq 'Pet News'
|
||||
end
|
||||
it 'extracts the expected values from open graph data' do
|
||||
expect(subject)
|
||||
.to have_attributes(
|
||||
canonical_url: eq('https://example.com/dog.html'),
|
||||
title: eq('Man bites dog'),
|
||||
description: eq("A dog's tale"),
|
||||
published_at: eq('2022-01-31T19:53:00+00:00'),
|
||||
author_name: eq('Charlie Brown'),
|
||||
language: eq('en'),
|
||||
image: eq('https://example.com/snoopy.jpg'),
|
||||
image_alt: eq('A good boy'),
|
||||
provider_name: eq('Pet News')
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -65,8 +65,7 @@ describe Mastodon::CLI::Accounts do
|
|||
|
||||
it 'exits with an error message' do
|
||||
expect { subject }
|
||||
.to output_results('Failure/Error: email')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, %r{Failure/Error: email})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -127,8 +126,7 @@ describe Mastodon::CLI::Accounts do
|
|||
|
||||
it 'exits with an error message indicating the role name was not found' do
|
||||
expect { subject }
|
||||
.to output_results('Cannot find user role with that name')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'Cannot find user role with that name')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -191,8 +189,7 @@ describe Mastodon::CLI::Accounts do
|
|||
|
||||
it 'exits with an error message indicating the user was not found' do
|
||||
expect { subject }
|
||||
.to output_results('No user with such username')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'No user with such username')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -214,8 +211,7 @@ describe Mastodon::CLI::Accounts do
|
|||
|
||||
it 'exits with an error message indicating the role was not found' do
|
||||
expect { subject }
|
||||
.to output_results('Cannot find user role with that name')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'Cannot find user role with that name')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -364,8 +360,7 @@ describe Mastodon::CLI::Accounts do
|
|||
|
||||
it 'exits with an error message' do
|
||||
expect { subject }
|
||||
.to output_results('Failure/Error: email')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, %r{Failure/Error: email})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -387,16 +382,14 @@ describe Mastodon::CLI::Accounts do
|
|||
|
||||
it 'exits with an error message indicating that only one should be used' do
|
||||
expect { subject }
|
||||
.to output_results('Use username or --email, not both')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'Use username or --email, not both')
|
||||
end
|
||||
end
|
||||
|
||||
context 'when neither username nor --email are provided' do
|
||||
it 'exits with an error message indicating that no username was provided' do
|
||||
expect { subject }
|
||||
.to output_results('No username provided')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'No username provided')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -425,8 +418,7 @@ describe Mastodon::CLI::Accounts do
|
|||
|
||||
it 'exits with an error message indicating that no user was found' do
|
||||
expect { subject }
|
||||
.to output_results('No user with such username')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'No user with such username')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -458,8 +450,7 @@ describe Mastodon::CLI::Accounts do
|
|||
|
||||
it 'exits with an error message indicating that no user was found' do
|
||||
expect { subject }
|
||||
.to output_results('No user with such email')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'No user with such email')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -511,8 +502,7 @@ describe Mastodon::CLI::Accounts do
|
|||
|
||||
it 'exits with an error message indicating that the number must be positive' do
|
||||
expect { subject }
|
||||
.to output_results('Number must be positive')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'Number must be positive')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -545,8 +535,7 @@ describe Mastodon::CLI::Accounts do
|
|||
|
||||
it 'exits with an error message indicating that no such account was found' do
|
||||
expect { subject }
|
||||
.to output_results('No such account')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'No such account')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -560,8 +549,7 @@ describe Mastodon::CLI::Accounts do
|
|||
|
||||
it 'exits with an error message indicating that no account with the given username was found' do
|
||||
expect { subject }
|
||||
.to output_results('No such account')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'No such account')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -596,8 +584,7 @@ describe Mastodon::CLI::Accounts do
|
|||
|
||||
it 'exits with an error message indicating that no account with the given username was found' do
|
||||
expect { subject }
|
||||
.to output_results('No such account')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'No such account')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -634,8 +621,7 @@ describe Mastodon::CLI::Accounts do
|
|||
|
||||
it 'exits with an error message indicating that there is no such account' do
|
||||
expect { subject }
|
||||
.to output_results('No user with such username')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'No user with such username')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -795,8 +781,7 @@ describe Mastodon::CLI::Accounts do
|
|||
allow(Account).to receive(:find_remote).with(account_example_com_b.username, account_example_com_b.domain).and_return(nil)
|
||||
|
||||
expect { subject }
|
||||
.to output_results('No such account')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'No such account')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -892,8 +877,7 @@ describe Mastodon::CLI::Accounts do
|
|||
context 'when neither a list of accts nor options are provided' do
|
||||
it 'exits with an error message' do
|
||||
expect { subject }
|
||||
.to output_results('No account(s) given')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'No account(s) given')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -904,8 +888,7 @@ describe Mastodon::CLI::Accounts do
|
|||
context 'when neither username nor --all option are given' do
|
||||
it 'exits with an error message' do
|
||||
expect { subject }
|
||||
.to output_results('No account(s) given')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'No account(s) given')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -940,8 +923,7 @@ describe Mastodon::CLI::Accounts do
|
|||
|
||||
it 'exits with an error message when the specified username is not found' do
|
||||
expect { subject }
|
||||
.to output_results('No such account')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'No such account')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -980,8 +962,7 @@ describe Mastodon::CLI::Accounts do
|
|||
shared_examples 'an account not found' do |acct|
|
||||
it 'exits with an error message indicating that there is no such account' do
|
||||
expect { subject }
|
||||
.to output_results("No such account (#{acct})")
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, "No such account (#{acct})")
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1031,8 +1012,7 @@ describe Mastodon::CLI::Accounts do
|
|||
|
||||
it 'exits with an error message indicating that the accounts do not have the same pub key' do
|
||||
expect { subject }
|
||||
.to output_results("Accounts don't have the same public key, might not be duplicates!\nOverride with --force")
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, "Accounts don't have the same public key, might not be duplicates!\nOverride with --force\n")
|
||||
end
|
||||
|
||||
context 'with --force option' do
|
||||
|
@ -1200,8 +1180,7 @@ describe Mastodon::CLI::Accounts do
|
|||
context 'when no option is given' do
|
||||
it 'exits with an error message indicating that at least one option is required' do
|
||||
expect { subject }
|
||||
.to output_results('Please specify either --follows or --followers, or both')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'Please specify either --follows or --followers, or both')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1211,8 +1190,7 @@ describe Mastodon::CLI::Accounts do
|
|||
|
||||
it 'exits with an error message indicating that there is no such account' do
|
||||
expect { subject }
|
||||
.to output_results('No such account')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'No such account')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1348,18 +1326,16 @@ describe Mastodon::CLI::Accounts do
|
|||
end
|
||||
|
||||
shared_examples 'a successful migration' do
|
||||
it 'calls the MoveService for the last migration' do
|
||||
expect { subject }
|
||||
.to output_results('OK')
|
||||
|
||||
last_migration = source_account.migrations.last
|
||||
|
||||
expect(move_service).to have_received(:call).with(last_migration).once
|
||||
end
|
||||
|
||||
it 'displays a successful message' do
|
||||
it 'displays a success message and calls the MoveService for the last migration' do
|
||||
expect { subject }
|
||||
.to output_results("OK, migrated #{source_account.acct} to #{target_account.acct}")
|
||||
|
||||
expect(move_service)
|
||||
.to have_received(:call).with(last_migration).once
|
||||
end
|
||||
|
||||
def last_migration
|
||||
source_account.migrations.last
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1368,16 +1344,14 @@ describe Mastodon::CLI::Accounts do
|
|||
|
||||
it 'exits with an error message indicating that using both options is not possible' do
|
||||
expect { subject }
|
||||
.to output_results('Use --replay or --target, not both')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'Use --replay or --target, not both')
|
||||
end
|
||||
end
|
||||
|
||||
context 'when no option is given' do
|
||||
it 'exits with an error message indicating that at least one option must be used' do
|
||||
expect { subject }
|
||||
.to output_results('Use either --replay or --target')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'Use either --replay or --target')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1387,8 +1361,7 @@ describe Mastodon::CLI::Accounts do
|
|||
|
||||
it 'exits with an error message indicating that there is no such account' do
|
||||
expect { subject }
|
||||
.to output_results("No such account: #{arguments.first}")
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, "No such account: #{arguments.first}")
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1398,8 +1371,7 @@ describe Mastodon::CLI::Accounts do
|
|||
context 'when the specified account has no previous migrations' do
|
||||
it 'exits with an error message indicating that the given account has no previous migrations' do
|
||||
expect { subject }
|
||||
.to output_results('The specified account has not performed any migration')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'The specified account has not performed any migration')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1421,8 +1393,7 @@ describe Mastodon::CLI::Accounts do
|
|||
|
||||
it 'exits with an error message' do
|
||||
expect { subject }
|
||||
.to output_results('The specified account is not redirecting to its last migration target. Use --force if you want to replay the migration anyway')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'The specified account is not redirecting to its last migration target. Use --force if you want to replay the migration anyway')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1449,8 +1420,7 @@ describe Mastodon::CLI::Accounts do
|
|||
|
||||
it 'exits with an error message indicating that there is no such account' do
|
||||
expect { subject }
|
||||
.to output_results("The specified target account could not be found: #{options[:target]}")
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, "The specified target account could not be found: #{options[:target]}")
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1474,8 +1444,7 @@ describe Mastodon::CLI::Accounts do
|
|||
context 'when the migration record is invalid' do
|
||||
it 'exits with an error indicating that the validation failed' do
|
||||
expect { subject }
|
||||
.to output_results('Error: Validation failed')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, /Error: Validation failed/)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1486,8 +1455,7 @@ describe Mastodon::CLI::Accounts do
|
|||
|
||||
it 'exits with an error message' do
|
||||
expect { subject }
|
||||
.to output_results('The specified account is redirecting to a different target account. Use --force if you want to change the migration target')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'The specified account is redirecting to a different target account. Use --force if you want to change the migration target')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -64,8 +64,7 @@ describe Mastodon::CLI::Cache do
|
|||
|
||||
it 'Exits with an error message' do
|
||||
expect { subject }
|
||||
.to output_results('Unknown')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, /Unknown/)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -35,8 +35,7 @@ describe Mastodon::CLI::EmailDomainBlocks do
|
|||
context 'without any options' do
|
||||
it 'warns about usage and exits' do
|
||||
expect { subject }
|
||||
.to output_results('No domain(s) given')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'No domain(s) given')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -72,8 +71,7 @@ describe Mastodon::CLI::EmailDomainBlocks do
|
|||
context 'without any options' do
|
||||
it 'warns about usage and exits' do
|
||||
expect { subject }
|
||||
.to output_results('No domain(s) given')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'No domain(s) given')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -42,8 +42,7 @@ describe Mastodon::CLI::Feeds do
|
|||
|
||||
it 'displays an error 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
|
||||
end
|
||||
|
|
|
@ -144,8 +144,7 @@ describe Mastodon::CLI::IpBlocks do
|
|||
|
||||
it 'exits with an error message' do
|
||||
expect { subject }
|
||||
.to output_results('No IP(s) given')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'No IP(s) given')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -235,8 +234,7 @@ describe Mastodon::CLI::IpBlocks do
|
|||
context 'when no IP address is provided' do
|
||||
it 'exits with an error message' do
|
||||
expect { subject }
|
||||
.to output_results('No IP(s) given')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, 'No IP(s) given')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -104,9 +104,9 @@ describe Mastodon::CLI::Main do
|
|||
answer_hostname_incorrectly
|
||||
end
|
||||
|
||||
it 'exits silently' do
|
||||
it 'exits with mismatch error message' do
|
||||
expect { subject }
|
||||
.to raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, /Domains do not match/)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -119,7 +119,7 @@ describe Mastodon::CLI::Main do
|
|||
it 'passes first step but stops before instructions' do
|
||||
expect { subject }
|
||||
.to output_results('operation WILL NOT')
|
||||
.and raise_error(SystemExit)
|
||||
.and raise_error(Thor::Error, /Self-destruct will not begin/)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -22,8 +22,7 @@ describe Mastodon::CLI::Maintenance do
|
|||
|
||||
it 'Exits with error message' do
|
||||
expect { subject }
|
||||
.to output_results('is too old')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, /is too old/)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -36,7 +35,7 @@ describe Mastodon::CLI::Maintenance do
|
|||
it 'Exits with error message' do
|
||||
expect { subject }
|
||||
.to output_results('more recent')
|
||||
.and raise_error(SystemExit)
|
||||
.and raise_error(Thor::Error, /more recent/)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -48,8 +47,7 @@ describe Mastodon::CLI::Maintenance do
|
|||
|
||||
it 'Exits with error message' do
|
||||
expect { subject }
|
||||
.to output_results('Sidekiq is running')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, /Sidekiq is running/)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -20,8 +20,7 @@ describe Mastodon::CLI::Search do
|
|||
|
||||
it 'Exits with error message' do
|
||||
expect { subject }
|
||||
.to output_results('this concurrency setting')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, /this concurrency setting/)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -30,8 +29,7 @@ describe Mastodon::CLI::Search do
|
|||
|
||||
it 'Exits with error message' do
|
||||
expect { subject }
|
||||
.to output_results('this batch_size setting')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, /this batch_size setting/)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -20,8 +20,7 @@ describe Mastodon::CLI::Statuses do
|
|||
|
||||
it 'exits with error message' do
|
||||
expect { subject }
|
||||
.to output_results('Cannot run')
|
||||
.and raise_error(SystemExit)
|
||||
.to raise_error(Thor::Error, /Cannot run/)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue