Deactivate rubocop guard
Somehow it disables the rspec guard, and this one is more important for me
This commit is contained in:
parent
522972bf29
commit
d5e586e66b
3 changed files with 61 additions and 5 deletions
12
Guardfile
12
Guardfile
|
@ -25,8 +25,10 @@ guard :rspec, cli: File.read('.rspec').split.push('--fail-fast').join(' '), keep
|
||||||
watch(%r{\Aspec/(?:unit|integration)/.+_spec\.rb\z})
|
watch(%r{\Aspec/(?:unit|integration)/.+_spec\.rb\z})
|
||||||
end
|
end
|
||||||
|
|
||||||
guard :rubocop, cli: %w[--config config/rubocop.yml] do
|
# Deactivated for now. Somehow it disables the rspec guard.
|
||||||
watch(%r{.+\.(?:rb|rake)\z})
|
#
|
||||||
watch(%r{\Aconfig/rubocop\.yml\z}) { |m| File.dirname(m[0]) }
|
# guard :rubocop, cli: %w[--config config/rubocop.yml] do
|
||||||
watch(%r{(?:.+/)?\.rubocop\.yml\z}) { |m| File.dirname(m[0]) }
|
# watch(%r{.+\.(?:rb|rake)\z})
|
||||||
end
|
# 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
43
lib/mutant/cli/builder.rb
Normal 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
|
11
spec/unit/mutant/cli/builder/rspec_spec.rb
Normal file
11
spec/unit/mutant/cli/builder/rspec_spec.rb
Normal 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
|
Loading…
Add table
Reference in a new issue