From 0e8ba19113182f74a0adde0ac75a35694833316c Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 6 Dec 2023 03:52:30 -0500 Subject: [PATCH] Add spec coverage for `CLI::Emoji` class (#28182) --- spec/fixtures/files/elite-assets.tar.gz | Bin 0 -> 17590 bytes spec/lib/mastodon/cli/emoji_spec.rb | 54 ++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 spec/fixtures/files/elite-assets.tar.gz diff --git a/spec/fixtures/files/elite-assets.tar.gz b/spec/fixtures/files/elite-assets.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..7b4f4425705c62fe4b538fa52148937e51a69552 GIT binary patch literal 17590 zcmV(nK=QvIiwFRdRBB}a1MIp5RGrPTD7bO=;0aE!;O_43Zo%Ds;~s)r(2ctVcMCy- zyKf-424`c#f6jUL-Z^vMc{6X_H*03i)L!-V*WJ}6-Bs27_1a9v&i1D6HjW++#-^@j z)=bWhR)GI%U}0h5;@}|rtK{b5{9DPw_V@bVfP;&bjFp3vosENogPoI;jD?l!?FS%Z z`7hVxKLHOncT?9lRUB+h9qpXF-0W=rbGkP&OUr-3=kKPF{ag9}7J$P;06+r(il$~{ z%Iah~WdDG_+5kvz$o7V>Z}?V+V*NkIQdC1j?eA}Y8v%Yp)qf&^`A0h@06=8s}+qrWN+%`?%`%(Zf@#sL8+qt588`2L;(PB|DDd+)ydPs(bUn*;;;V4H{|-?^}BeO zx|%w^d9?*#Q{MJ(MDo#le1Fpj0DxRo(ss~F3Ar${u<@|-b8&K+a(p)D=I7^?aKVBr)KW8wIpo8@>`1k%V)8Jpg|HtE>jhD>9-NwN}kd>Q-m4l0eorRT&larT)_ia^> zSy@@h6lBFj)x>3FwIrFmP2JsHnf|jd6I7ItV^h-5vsRLpvs3bQ<5t$xWKm_& zWmWPObyxKjlTcD;VNtTvWmnLYl2nq^bXU}{mr}A7Wl@yS5?6gIk$HH@)ZZj2=>987 z{}VBb%*p+)%=q_gA}FdVD$3xg>?*I|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/spec/lib/mastodon/cli/emoji_spec.rb +++ b/spec/lib/mastodon/cli/emoji_spec.rb @@ -4,5 +4,59 @@ require 'rails_helper' require 'mastodon/cli/emoji' describe Mastodon::CLI::Emoji do + subject { cli.invoke(action, args, options) } + + let(:cli) { described_class.new } + let(:args) { [] } + let(:options) { {} } + it_behaves_like 'CLI Command' + + describe '#purge' do + let(:action) { :purge } + + context 'with existing custom emoji' do + before { Fabricate(:custom_emoji) } + + it 'reports a successful purge' do + expect { subject } + .to output_results('OK') + end + end + end + + describe '#import' do + context 'with existing custom emoji' do + let(:import_path) { Rails.root.join('spec', 'fixtures', 'files', 'elite-assets.tar.gz') } + let(:action) { :import } + let(:args) { [import_path] } + + it 'reports about imported emoji' do + expect { subject } + .to output_results('Imported 1') + .and change(CustomEmoji, :count).by(1) + end + end + end + + describe '#export' do + context 'with existing custom emoji' do + before { Fabricate(:custom_emoji) } + after { File.delete(export_path) } + + let(:export_path) { Rails.root.join('tmp', 'export.tar.gz') } + let(:args) { [Rails.root.join('tmp')] } + let(:action) { :export } + + it 'reports about exported emoji' do + expect { subject } + .to output_results('Exported 1') + .and change { File.exist?(export_path) }.from(false).to(true) + end + end + end + + def output_results(string) + output(a_string_including(string)).to_stdout + end end