Equalize CLI on generated config object
This commit is contained in:
parent
af9dfc5a16
commit
15376e6314
2 changed files with 7 additions and 5 deletions
|
@ -2,7 +2,7 @@ module Mutant
|
|||
|
||||
# Comandline parser
|
||||
class CLI < CLIParser
|
||||
include Adamantium::Flat, Equalizer.new(:matcher, :filter, :strategy, :reporter)
|
||||
include Adamantium::Flat, Equalizer.new(:config)
|
||||
|
||||
# Run cli with arguments
|
||||
#
|
||||
|
@ -113,7 +113,7 @@ module Mutant
|
|||
# @api private
|
||||
#
|
||||
def reporter
|
||||
Mutant::Reporter::CLI.new(self)
|
||||
Mutant::Reporter::CLI.new($stdout)
|
||||
end
|
||||
memoize :reporter
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ shared_examples_for 'an invalid cli run' do
|
|||
end
|
||||
|
||||
shared_examples_for 'a cli parser' do
|
||||
subject { cli.config }
|
||||
its(:filter) { should eql(expected_filter) }
|
||||
its(:strategy) { should eql(expected_strategy.new(subject)) }
|
||||
its(:reporter) { should eql(expected_reporter) }
|
||||
|
@ -25,9 +26,11 @@ describe Mutant::CLI, '.new' do
|
|||
# Defaults
|
||||
let(:expected_filter) { Mutant::Mutation::Filter::ALL }
|
||||
let(:expected_strategy) { Mutant::Strategy::Rspec::Unit }
|
||||
let(:expected_reporter) { Mutant::Reporter::CLI.new($stderr) }
|
||||
let(:expected_reporter) { Mutant::Reporter::CLI.new($stdout) }
|
||||
|
||||
subject { object.new(arguments) }
|
||||
let(:cli) { object.new(arguments) }
|
||||
|
||||
subject { cli }
|
||||
|
||||
context 'with unknown flag' do
|
||||
let(:arguments) { %w(--invalid) }
|
||||
|
@ -71,7 +74,6 @@ describe Mutant::CLI, '.new' do
|
|||
let(:expected_matcher) { Mutant::CLI::Classifier::Method.new('TestApp::Literal#float') }
|
||||
|
||||
it_should_behave_like 'a cli parser'
|
||||
|
||||
end
|
||||
|
||||
context 'with namespace matcher' do
|
||||
|
|
Loading…
Reference in a new issue