Skip to content

Commit

Permalink
Merge pull request #35 from guard/misc_option_fixes
Browse files Browse the repository at this point in the history
fix option default, docs and Guardfile template
  • Loading branch information
e2 committed Apr 28, 2016
2 parents d06f281 + 8978fa0 commit 987db92
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
3 changes: 2 additions & 1 deletion lib/guard/cucumber.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
18 changes: 17 additions & 1 deletion lib/guard/cucumber/templates/Guardfile
Original file line number Diff line number Diff line change
@@ -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" }

Expand Down
5 changes: 3 additions & 2 deletions spec/guard/cucumber_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 987db92

Please sign in to comment.