From 97c3ca5fde7d81ecfd8687dfd4ff66ed00880936 Mon Sep 17 00:00:00 2001 From: Markus Schirp Date: Wed, 17 Jul 2013 20:03:52 +0200 Subject: [PATCH] Reconnect static strategies to cli --- lib/mutant/cli.rb | 6 ++++++ spec/unit/mutant/cli/class_methods/new_spec.rb | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/mutant/cli.rb b/lib/mutant/cli.rb index decc9e04..efda41dc 100644 --- a/lib/mutant/cli.rb +++ b/lib/mutant/cli.rb @@ -240,6 +240,12 @@ module Mutant # @api private # def add_strategies(opts) + opts.on('--static-success', 'does succeed on all mutations') do + set_strategy Strategy::Static::Success.new + end + opts.on('--static-fail', 'does fail on all mutations') do + set_strategy Strategy::Static::Fail.new + end opts.on('--rspec', 'kills mutations with rspec') do set_strategy Strategy::Rspec.new end diff --git a/spec/unit/mutant/cli/class_methods/new_spec.rb b/spec/unit/mutant/cli/class_methods/new_spec.rb index 00b1f5d0..879b2899 100644 --- a/spec/unit/mutant/cli/class_methods/new_spec.rb +++ b/spec/unit/mutant/cli/class_methods/new_spec.rb @@ -49,9 +49,10 @@ describe Mutant::CLI, '.new' do end context 'with many strategy flags' do - let(:arguments) { %w(--rspec) } + let(:arguments) { %w(--static-fail --rspec TestApp) } + let(:expected_matcher) { Mutant::CLI::Classifier::Namespace::Flat.new(Mutant::Cache.new, 'TestApp') } - let(:expected_strategy) { Mutant::Strategy::Rspec } + it_should_behave_like 'a cli parser' end context 'without arguments' do