Formalize some patterns in cli specs (#28255)
This commit is contained in:
parent
5d97a897c8
commit
ad34d33bfd
17 changed files with 492 additions and 449 deletions
|
@ -4,13 +4,20 @@ require 'rails_helper'
|
|||
require 'mastodon/cli/main'
|
||||
|
||||
describe Mastodon::CLI::Main do
|
||||
subject { cli.invoke(action, arguments, options) }
|
||||
|
||||
let(:cli) { described_class.new }
|
||||
let(:arguments) { [] }
|
||||
let(:options) { {} }
|
||||
|
||||
it_behaves_like 'CLI Command'
|
||||
|
||||
describe 'version' do
|
||||
describe '#version' do
|
||||
let(:action) { :version }
|
||||
|
||||
it 'returns the Mastodon version' do
|
||||
expect { described_class.new.invoke(:version) }.to output(
|
||||
a_string_including(Mastodon::Version.to_s)
|
||||
).to_stdout
|
||||
expect { subject }
|
||||
.to output_results(Mastodon::Version.to_s)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue