Fix rubocop warnings

This commit is contained in:
Dan Kubb 2013-09-14 22:32:41 -07:00
parent fa149c7cad
commit a084837cdb
5 changed files with 6 additions and 13 deletions

View file

@ -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

View file

@ -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! ' +

View file

@ -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 }

View file

@ -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 }

View file

@ -20,4 +20,3 @@ describe Mutant::Strategy do
it_should_behave_like 'a command method'
end
end