From a084837cdb301f40889198ee235d58b1436abdc6 Mon Sep 17 00:00:00 2001 From: Dan Kubb Date: Sat, 14 Sep 2013 22:32:41 -0700 Subject: [PATCH] Fix rubocop warnings --- lib/mutant/cli/classifier.rb | 6 ++---- lib/mutant/differ.rb | 8 ++------ spec/unit/mutant/cli/classifier/namespace/flat_spec.rb | 2 +- .../mutant/cli/classifier/namespace/recursive_spec.rb | 2 +- spec/unit/mutant/strategy_spec.rb | 1 - 5 files changed, 6 insertions(+), 13 deletions(-) diff --git a/lib/mutant/cli/classifier.rb b/lib/mutant/cli/classifier.rb index 417b9bae..18a76ca3 100644 --- a/lib/mutant/cli/classifier.rb +++ b/lib/mutant/cli/classifier.rb @@ -44,11 +44,9 @@ module Mutant # @api private # def self.constant_lookup(location) - location - .sub(CBASE_PATTERN, EMPTY_STRING) - .split(SCOPE_OPERATOR) + location.sub(CBASE_PATTERN, EMPTY_STRING).split(SCOPE_OPERATOR) .reduce(Object) do |parent, name| - parent.const_get(name, nil) + parent.const_get(name, nil) end end diff --git a/lib/mutant/differ.rb b/lib/mutant/differ.rb index 1c67df41..fed5cd4d 100644 --- a/lib/mutant/differ.rb +++ b/lib/mutant/differ.rb @@ -16,16 +16,12 @@ module Mutant # @api private # def diff - output = '' case diffs.length when 0 nil when 1 - output = - Diff::LCS::Hunk.new( - old, new, diffs.first, max_length, 0 - ).diff(:unified) - output << "\n" + Diff::LCS::Hunk.new(old, new, diffs.first, max_length, 0) + .diff(:unified) << "\n" else $stderr.puts( 'Mutation resulted in more than one diff, should not happen! ' + diff --git a/spec/unit/mutant/cli/classifier/namespace/flat_spec.rb b/spec/unit/mutant/cli/classifier/namespace/flat_spec.rb index 9580fe9c..83ad026b 100644 --- a/spec/unit/mutant/cli/classifier/namespace/flat_spec.rb +++ b/spec/unit/mutant/cli/classifier/namespace/flat_spec.rb @@ -32,7 +32,7 @@ describe Mutant::CLI::Classifier::Namespace::Flat, '#each' do end context 'without a block' do - subject { object.each } + subject { object.each } context 'with a known namespace' do let(:input) { known_namespace } diff --git a/spec/unit/mutant/cli/classifier/namespace/recursive_spec.rb b/spec/unit/mutant/cli/classifier/namespace/recursive_spec.rb index 9cdb956e..3e3f3cd5 100644 --- a/spec/unit/mutant/cli/classifier/namespace/recursive_spec.rb +++ b/spec/unit/mutant/cli/classifier/namespace/recursive_spec.rb @@ -32,7 +32,7 @@ describe Mutant::CLI::Classifier::Namespace::Recursive, '#each' do end context 'without a block' do - subject { object.each } + subject { object.each } context 'with a known namespace' do let(:input) { known_namespace } diff --git a/spec/unit/mutant/strategy_spec.rb b/spec/unit/mutant/strategy_spec.rb index bca29f30..b083fcda 100644 --- a/spec/unit/mutant/strategy_spec.rb +++ b/spec/unit/mutant/strategy_spec.rb @@ -20,4 +20,3 @@ describe Mutant::Strategy do it_should_behave_like 'a command method' end end -