Deactivate rubocop guard

Somehow it disables the rspec guard, and this one is more important for
me
This commit is contained in:
Markus Schirp 2013-09-01 23:37:22 +02:00
parent 522972bf29
commit d5e586e66b
3 changed files with 61 additions and 5 deletions

View file

@ -25,8 +25,10 @@ guard :rspec, cli: File.read('.rspec').split.push('--fail-fast').join(' '), keep
watch(%r{\Aspec/(?:unit|integration)/.+_spec\.rb\z})
end
guard :rubocop, cli: %w[--config config/rubocop.yml] do
watch(%r{.+\.(?:rb|rake)\z})
watch(%r{\Aconfig/rubocop\.yml\z}) { |m| File.dirname(m[0]) }
watch(%r{(?:.+/)?\.rubocop\.yml\z}) { |m| File.dirname(m[0]) }
end
# Deactivated for now. Somehow it disables the rspec guard.
#
# guard :rubocop, cli: %w[--config config/rubocop.yml] do
# watch(%r{.+\.(?:rb|rake)\z})
# watch(%r{\Aconfig/rubocop\.yml\z}) { |m| File.dirname(m[0]) }
# watch(%r{(?:.+/)?\.rubocop\.yml\z}) { |m| File.dirname(m[0]) }
# end

43
lib/mutant/cli/builder.rb Normal file
View file

@ -0,0 +1,43 @@
module Mutant
class CLI
# Abstract base class for strategy builders
class Builder
# Rspec strategy builder
class Rspec
# Initialize object
#
# @return [undefined]
#
# @api private
#
def initialize
@level = 0
end
# Set rspec level
#
# @return [self]
#
# @api private
#
def set_level(level)
@level = level
self
end
# Return strategy
#
# @return [Strategy::Rspec]
#
# @api private
#
def strategy
Strategy::Rspec.new(@level)
end
end # Rspec
end # Builder
end # CLI
end # Mutant

View file

@ -0,0 +1,11 @@
require 'spec_helper'
describe Mutant::CLI::Builder::Rspec do
let(:object) { described_class.new }
describe '#strategy' do
let(:level) { double('Level') }
it { should eql(Mutant::Strategy::Rspec.new(level)) }
end
end