Sha256: 8c9e3ba6b7a96a2d076e063ccfe0529e12ff8011df3e5f6979901e362a44896f

Contents?: true

Size: 1002 Bytes

Versions: 3

Compression:

Stored size: 1002 Bytes

Contents

group :red_green_refactor, halt_on_fail: true do
  guard :rspec, cmd: 'bundle exec rspec' do
    require 'guard/rspec/dsl'
    dsl = Guard::RSpec::Dsl.new(self)

    # RSpec files
    rspec = dsl.rspec
    watch(rspec.spec_helper) { rspec.spec_dir }
    watch(rspec.spec_support) { rspec.spec_dir }
    watch(rspec.spec_files)

    # Ruby files
    ruby = dsl.ruby
    dsl.watch_spec_files_for(ruby.lib_files)

    # Turnip features and steps
    watch(%r{^spec/acceptance/(.+)\.feature$})
    watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
      Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance'
    end

    # BaseModel subclasses
    watch('lib/securetrading/base_model.rb') do
      %w(amount billing record response).map do |name|
        "spec/securetrading/#{name}_spec.rb"
      end 
    end
  end

  guard :rubocop, all_on_start: false, cli: ['--rails', '--auto-correct'] do
    watch(/.+\.rb$/)
    watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
securetrading-0.4.0 Guardfile
securetrading-0.3.2 Guardfile
securetrading-0.3.1 Guardfile