Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix option default, docs and Guardfile template #35

Merged
merged 3 commits into from
Apr 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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