diff options
author | Matt Jankowski <matt@jankowski.online> | 2023-05-24 05:55:40 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-24 11:55:40 +0200 |
commit | 384345b0de9cc6b8cc62bbf60f2361449995717d (patch) | |
tree | ef1c703307d4ee668985589ce7bb08f5ec7fa60a /spec/lib | |
parent | d2e5430d4a4f3828f5adbd7429752f9f11cfc07f (diff) |
Add CLI Base class for command line code (#25106)
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/mastodon/cli/accounts_spec.rb | 12 | ||||
-rw-r--r-- | spec/lib/mastodon/cli/cache_spec.rb | 12 | ||||
-rw-r--r-- | spec/lib/mastodon/cli/canonical_email_blocks_spec.rb | 12 | ||||
-rw-r--r-- | spec/lib/mastodon/cli/domains_spec.rb | 12 | ||||
-rw-r--r-- | spec/lib/mastodon/cli/email_domain_blocks_spec.rb | 12 | ||||
-rw-r--r-- | spec/lib/mastodon/cli/emoji_spec.rb | 12 | ||||
-rw-r--r-- | spec/lib/mastodon/cli/feeds_spec.rb | 12 | ||||
-rw-r--r-- | spec/lib/mastodon/cli/ip_blocks_spec.rb | 8 | ||||
-rw-r--r-- | spec/lib/mastodon/cli/main_spec.rb | 6 | ||||
-rw-r--r-- | spec/lib/mastodon/cli/maintenance_spec.rb | 12 | ||||
-rw-r--r-- | spec/lib/mastodon/cli/media_spec.rb | 12 | ||||
-rw-r--r-- | spec/lib/mastodon/cli/preview_cards_spec.rb | 12 | ||||
-rw-r--r-- | spec/lib/mastodon/cli/search_spec.rb | 12 | ||||
-rw-r--r-- | spec/lib/mastodon/cli/settings_spec.rb | 8 | ||||
-rw-r--r-- | spec/lib/mastodon/cli/statuses_spec.rb | 12 | ||||
-rw-r--r-- | spec/lib/mastodon/cli/upgrade_spec.rb | 12 |
16 files changed, 176 insertions, 2 deletions
diff --git a/spec/lib/mastodon/cli/accounts_spec.rb b/spec/lib/mastodon/cli/accounts_spec.rb new file mode 100644 index 00000000000..25f1311d40e --- /dev/null +++ b/spec/lib/mastodon/cli/accounts_spec.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +require 'rails_helper' +require 'mastodon/cli/accounts' + +describe Mastodon::CLI::Accounts do + describe '.exit_on_failure?' do + it 'returns true' do + expect(described_class.exit_on_failure?).to be true + end + end +end diff --git a/spec/lib/mastodon/cli/cache_spec.rb b/spec/lib/mastodon/cli/cache_spec.rb new file mode 100644 index 00000000000..f101bc200f8 --- /dev/null +++ b/spec/lib/mastodon/cli/cache_spec.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +require 'rails_helper' +require 'mastodon/cli/cache' + +describe Mastodon::CLI::Cache do + describe '.exit_on_failure?' do + it 'returns true' do + expect(described_class.exit_on_failure?).to be true + end + end +end diff --git a/spec/lib/mastodon/cli/canonical_email_blocks_spec.rb b/spec/lib/mastodon/cli/canonical_email_blocks_spec.rb new file mode 100644 index 00000000000..fb481e8a821 --- /dev/null +++ b/spec/lib/mastodon/cli/canonical_email_blocks_spec.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +require 'rails_helper' +require 'mastodon/cli/canonical_email_blocks' + +describe Mastodon::CLI::CanonicalEmailBlocks do + describe '.exit_on_failure?' do + it 'returns true' do + expect(described_class.exit_on_failure?).to be true + end + end +end diff --git a/spec/lib/mastodon/cli/domains_spec.rb b/spec/lib/mastodon/cli/domains_spec.rb new file mode 100644 index 00000000000..ea58845c00b --- /dev/null +++ b/spec/lib/mastodon/cli/domains_spec.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +require 'rails_helper' +require 'mastodon/cli/domains' + +describe Mastodon::CLI::Domains do + describe '.exit_on_failure?' do + it 'returns true' do + expect(described_class.exit_on_failure?).to be true + end + end +end diff --git a/spec/lib/mastodon/cli/email_domain_blocks_spec.rb b/spec/lib/mastodon/cli/email_domain_blocks_spec.rb new file mode 100644 index 00000000000..333ae3f2b74 --- /dev/null +++ b/spec/lib/mastodon/cli/email_domain_blocks_spec.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +require 'rails_helper' +require 'mastodon/cli/email_domain_blocks' + +describe Mastodon::CLI::EmailDomainBlocks do + describe '.exit_on_failure?' do + it 'returns true' do + expect(described_class.exit_on_failure?).to be true + end + end +end diff --git a/spec/lib/mastodon/cli/emoji_spec.rb b/spec/lib/mastodon/cli/emoji_spec.rb new file mode 100644 index 00000000000..9b586537299 --- /dev/null +++ b/spec/lib/mastodon/cli/emoji_spec.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +require 'rails_helper' +require 'mastodon/cli/emoji' + +describe Mastodon::CLI::Emoji do + describe '.exit_on_failure?' do + it 'returns true' do + expect(described_class.exit_on_failure?).to be true + end + end +end diff --git a/spec/lib/mastodon/cli/feeds_spec.rb b/spec/lib/mastodon/cli/feeds_spec.rb new file mode 100644 index 00000000000..4e1e214effb --- /dev/null +++ b/spec/lib/mastodon/cli/feeds_spec.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +require 'rails_helper' +require 'mastodon/cli/feeds' + +describe Mastodon::CLI::Feeds do + describe '.exit_on_failure?' do + it 'returns true' do + expect(described_class.exit_on_failure?).to be true + end + end +end diff --git a/spec/lib/mastodon/cli/ip_blocks_spec.rb b/spec/lib/mastodon/cli/ip_blocks_spec.rb index e7639d9aafe..e192679a59e 100644 --- a/spec/lib/mastodon/cli/ip_blocks_spec.rb +++ b/spec/lib/mastodon/cli/ip_blocks_spec.rb @@ -3,9 +3,15 @@ require 'rails_helper' require 'mastodon/cli/ip_blocks' -RSpec.describe Mastodon::CLI::IpBlocks do +describe Mastodon::CLI::IpBlocks do let(:cli) { described_class.new } + describe '.exit_on_failure?' do + it 'returns true' do + expect(described_class.exit_on_failure?).to be true + end + end + describe '#add' do let(:ip_list) do [ diff --git a/spec/lib/mastodon/cli/main_spec.rb b/spec/lib/mastodon/cli/main_spec.rb index 105c4ec3710..e3709afe37a 100644 --- a/spec/lib/mastodon/cli/main_spec.rb +++ b/spec/lib/mastodon/cli/main_spec.rb @@ -4,6 +4,12 @@ require 'rails_helper' require 'mastodon/cli/main' describe Mastodon::CLI::Main do + describe '.exit_on_failure?' do + it 'returns true' do + expect(described_class.exit_on_failure?).to be true + end + end + describe 'version' do it 'returns the Mastodon version' do expect { described_class.new.invoke(:version) }.to output( diff --git a/spec/lib/mastodon/cli/maintenance_spec.rb b/spec/lib/mastodon/cli/maintenance_spec.rb new file mode 100644 index 00000000000..12cd9ca8a65 --- /dev/null +++ b/spec/lib/mastodon/cli/maintenance_spec.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +require 'rails_helper' +require 'mastodon/cli/maintenance' + +describe Mastodon::CLI::Maintenance do + describe '.exit_on_failure?' do + it 'returns true' do + expect(described_class.exit_on_failure?).to be true + end + end +end diff --git a/spec/lib/mastodon/cli/media_spec.rb b/spec/lib/mastodon/cli/media_spec.rb new file mode 100644 index 00000000000..29f7d424a9c --- /dev/null +++ b/spec/lib/mastodon/cli/media_spec.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +require 'rails_helper' +require 'mastodon/cli/media' + +describe Mastodon::CLI::Media do + describe '.exit_on_failure?' do + it 'returns true' do + expect(described_class.exit_on_failure?).to be true + end + end +end diff --git a/spec/lib/mastodon/cli/preview_cards_spec.rb b/spec/lib/mastodon/cli/preview_cards_spec.rb new file mode 100644 index 00000000000..b4b018b3be5 --- /dev/null +++ b/spec/lib/mastodon/cli/preview_cards_spec.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +require 'rails_helper' +require 'mastodon/cli/preview_cards' + +describe Mastodon::CLI::PreviewCards do + describe '.exit_on_failure?' do + it 'returns true' do + expect(described_class.exit_on_failure?).to be true + end + end +end diff --git a/spec/lib/mastodon/cli/search_spec.rb b/spec/lib/mastodon/cli/search_spec.rb new file mode 100644 index 00000000000..d5cae5bf49f --- /dev/null +++ b/spec/lib/mastodon/cli/search_spec.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +require 'rails_helper' +require 'mastodon/cli/search' + +describe Mastodon::CLI::Search do + describe '.exit_on_failure?' do + it 'returns true' do + expect(described_class.exit_on_failure?).to be true + end + end +end diff --git a/spec/lib/mastodon/cli/settings_spec.rb b/spec/lib/mastodon/cli/settings_spec.rb index 01f07756284..ae58e74e56d 100644 --- a/spec/lib/mastodon/cli/settings_spec.rb +++ b/spec/lib/mastodon/cli/settings_spec.rb @@ -3,7 +3,13 @@ require 'rails_helper' require 'mastodon/cli/settings' -RSpec.describe Mastodon::CLI::Settings do +describe Mastodon::CLI::Settings do + describe '.exit_on_failure?' do + it 'returns true' do + expect(described_class.exit_on_failure?).to be true + end + end + describe 'subcommand "registrations"' do let(:cli) { Mastodon::CLI::Registrations.new } diff --git a/spec/lib/mastodon/cli/statuses_spec.rb b/spec/lib/mastodon/cli/statuses_spec.rb new file mode 100644 index 00000000000..2430a884164 --- /dev/null +++ b/spec/lib/mastodon/cli/statuses_spec.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +require 'rails_helper' +require 'mastodon/cli/statuses' + +describe Mastodon::CLI::Statuses do + describe '.exit_on_failure?' do + it 'returns true' do + expect(described_class.exit_on_failure?).to be true + end + end +end diff --git a/spec/lib/mastodon/cli/upgrade_spec.rb b/spec/lib/mastodon/cli/upgrade_spec.rb new file mode 100644 index 00000000000..9e0ab9d06e4 --- /dev/null +++ b/spec/lib/mastodon/cli/upgrade_spec.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +require 'rails_helper' +require 'mastodon/cli/upgrade' + +describe Mastodon::CLI::Upgrade do + describe '.exit_on_failure?' do + it 'returns true' do + expect(described_class.exit_on_failure?).to be true + end + end +end |