https://github.com/guard/guard
Revision ed70168cacb0b601a8600b44ea1672d8bd8488c9 authored by Rémy Coutable on 01 November 2019, 11:52:11 UTC, committed by GitHub on 01 November 2019, 11:52:11 UTC
Signed-off-by: Rémy Coutable <remy@rymai.me>
1 parent 7b9bb18
Raw File
Tip revision: ed70168cacb0b601a8600b44ea1672d8bd8488c9 authored by Rémy Coutable on 01 November 2019, 11:52:11 UTC
Bump to 2.16.1 (#945)
Tip revision: ed70168
handle_failing_task.feature
Feature: gracefully handling plugin failures

  In order to prevent restarting Guard after plugin failures
  As a user
  I want Guard to gracefully ignore plugin failures

  Background: Guard is installed through bundler
    Given Guard is bundled using source

  @spawn
  Scenario: Continue after a failing task
    Given my Guardfile contains:
    """
    require 'guard/plugin'

    module ::Guard
      class EpicFail < Plugin
        def run_on_modifications(files)
          fail "epic fail!"
        end
      end

      class Myplugin < Plugin
        def run_on_additions(files)
          $stdout.puts "Files added: #{files.inspect}"
          $stdout.flush
        end
      end
    end

    guard(:epic_fail) { watch('foo') }
    guard(:myplugin) { watch('bar') }

    """
    Given an empty file named "foo"
    When I start `bundle exec guard -n f`
    And I append to the file "foo"
    And I create a file "bar"
    And I wait for Guard to become idle
    And I stop guard
    Then the output should match /Files added: \["bar"\]/
back to top