Navigation Menu

Skip to content

Commit

Permalink
Include guardfile from morpher, compatible with latest guard-rspec
Browse files Browse the repository at this point in the history
  • Loading branch information
mbj committed Jan 18, 2014
1 parent b01294e commit 4c26dc7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 26 deletions.
32 changes: 7 additions & 25 deletions Guardfile
Expand Up @@ -2,33 +2,15 @@

guard :bundler do
watch('Gemfile')
watch('Gemfile.lock')
watch(%w{.+.gemspec\z})
end

guard :rspec, cli: File.read('.rspec').split.push('--fail-fast').join(' '), keep_failed: false do
# Run all specs if configuration is modified
watch('.rspec') { 'spec' }
watch('Guardfile') { 'spec' }
watch('Gemfile.lock') { 'spec' }
watch('spec/spec_helper.rb') { 'spec' }
guard :rspec, :all_after_pass => false, :all_on_start => false, :cmd => 'bundle exec rspec --fail-fast --seed 0' do
# run all specs if the spec_helper or supporting files files are modified
watch('spec/spec_helper.rb') { 'spec/unit' }
watch(%r{\Aspec/(?:lib|support|shared)/.+\.rb\z}) { 'spec/unit' }

# Run all specs if supporting files files are modified
watch(%r{\Aspec/(?:fixtures|lib|support|shared)/.+\.rb\z}) { 'spec' }
watch(%r{lib/.*.rb}) { 'spec/unit' }

# Run unit specs if associated lib code is modified
watch(%r{\Alib/(.+)\.rb\z}) { |m| Dir["spec/unit/#{m[1]}*"] }
watch(%r{\Alib/(.+)/support/(.+)\.rb\z}) { |m| Dir["spec/unit/#{m[1]}/#{m[2]}*"] }
watch("lib/#{File.basename(File.expand_path('../', __FILE__))}.rb") { 'spec' }

# Run a spec if it is modified
watch(%r{\Aspec/(?:unit|integration)/.+_spec\.rb\z})
# run a spec if it is modified
watch(%r{\Aspec/.+_spec\.rb\z})
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
1 change: 1 addition & 0 deletions lib/mutant.rb
Expand Up @@ -32,6 +32,7 @@ module Mutant
require 'mutant/singleton_methods'
require 'mutant/constants'
require 'mutant/random'
require 'mutant/walker'
require 'mutant/predicate'
require 'mutant/predicate/attribute'
require 'mutant/predicate/whitelist'
Expand Down
4 changes: 3 additions & 1 deletion lib/mutant/cli.rb
Expand Up @@ -43,6 +43,7 @@ def self.run(arguments)
def initialize(arguments = [])
@filters, @matchers = [], []
@debug = @fail_fast = @zombie = false
@expect_coverage = 100.0
@strategy = Strategy::Null.new
@cache = Mutant::Cache.new
parse(arguments)
Expand All @@ -64,7 +65,8 @@ def config
subject_predicate: @subject_predicate.output,
strategy: @strategy,
fail_fast: @fail_fast,
reporter: reporter
reporter: reporter,
expect_coverage: @expect_coverage
)
end
memoize :config
Expand Down

0 comments on commit 4c26dc7

Please sign in to comment.