From a5755f6212b2b662edd4eb639e66e433245ca474 Mon Sep 17 00:00:00 2001 From: Cezary Baginski Date: Thu, 28 Apr 2016 03:38:49 +0200 Subject: [PATCH 1/3] make default options match README.md --- lib/guard/cucumber.rb | 3 ++- spec/guard/cucumber_spec.rb | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/guard/cucumber.rb b/lib/guard/cucumber.rb index 723b074..6156346 100644 --- a/lib/guard/cucumber.rb +++ b/lib/guard/cucumber.rb @@ -49,7 +49,8 @@ def initialize(options = {}) all_after_pass: true, all_on_start: true, keep_failed: true, - cmd_additional_args: "", + cmd: "cucumber", + cmd_additional_args: "--no-profile --color --format progress --strict", feature_sets: ["features"] }.update(options) diff --git a/spec/guard/cucumber_spec.rb b/spec/guard/cucumber_spec.rb index 8b831e6..bc6d7fd 100644 --- a/spec/guard/cucumber_spec.rb +++ b/spec/guard/cucumber_spec.rb @@ -18,7 +18,8 @@ all_after_pass: true, all_on_start: true, keep_failed: true, - cmd_additional_args: "", + cmd: "cucumber", + cmd_additional_args: "--no-profile --color --format progress --strict", feature_sets: ["features"] } end @@ -41,7 +42,7 @@ it "sets a default :cmd_additional_args option" do expect(subject.options[:cmd_additional_args]). - to eql "" + to eql "--no-profile --color --format progress --strict" end it "sets a default :feature_sets option" do From 9698b17a2baaddcfb74af14dfe09e98e2941bb10 Mon Sep 17 00:00:00 2001 From: Cezary Baginski Date: Thu, 28 Apr 2016 03:39:13 +0200 Subject: [PATCH 2/3] fix README option example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c606c4c..531a129 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ all_on_start: false # Don't run all the features at startup keep_failed: false # Keep failed features until they pass # default: true -run_all: {cmd: "-p"} # Override any option when running all specs +run_all: {cmd_additional_args: "--format pretty"} # Override any option when running all specs # default: {} focus_on: 'dev' # Focus on scenarios tagged with '@dev' From 8978fa0c9f3256c31e1dab2fdbb6eea49eebc082 Mon Sep 17 00:00:00 2001 From: Cezary Baginski Date: Thu, 28 Apr 2016 03:39:38 +0200 Subject: [PATCH 3/3] conveniently attach sample options (template) --- lib/guard/cucumber/templates/Guardfile | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/guard/cucumber/templates/Guardfile b/lib/guard/cucumber/templates/Guardfile index cf15065..c79fa80 100644 --- a/lib/guard/cucumber/templates/Guardfile +++ b/lib/guard/cucumber/templates/Guardfile @@ -1,4 +1,20 @@ -guard "cucumber" do +cucumber_options = { + # Below are examples overriding defaults + + # cmd: 'bin/cucumber', + # cmd_additional_args: '--profile guard', + + # all_after_pass: false, + # all_on_start: false, + # keep_failed: false, + # feature_sets: ['features/frontend', 'features/experimental'], + + # run_all: { cmd_additional_args: '--profile guard_all' }, + # focus_on: { 'wip' }, # @wip + # notification: false +} + +guard "cucumber", cucumber_options do watch(%r{^features/.+\.feature$}) watch(%r{^features/support/.+$}) { "features" }