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

Apply additional arguments to :cmd after defaults. #279

Merged
merged 3 commits into from
Jul 24, 2014
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: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ end

``` ruby
cmd: 'zeus rspec' # Specify a custom rspec command to run, default: 'rspec'
cmd_additional_args: '-f progress' # Any arguments that should be added after the default
# arguments are applied but before the spec list
spec_paths: ['spec'] # Specify a custom array of paths that contain spec files
failed_mode: :focus # What to do with failed specs
# Available values:
Expand Down
1 change: 1 addition & 0 deletions lib/guard/rspec/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def _parts
parts << _visual_formatter
parts << _guard_formatter
parts << "--failure-exit-code #{FAILURE_EXIT_CODE}"
parts << options[:cmd_additional_args] || ""
parts << paths.join(' ')
end

Expand Down
1 change: 1 addition & 0 deletions lib/guard/rspec/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module Options
failed_mode: :none, # :keep and :focus are other posibilities
spec_paths: %w[spec],
cmd: nil,
cmd_additional_args: nil,
launchy: nil,
notification: true
}
Expand Down
8 changes: 8 additions & 0 deletions spec/lib/guard/rspec/command_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@
expect(command).to match %r{-f doc}
end
end

context "with cmd_additional_args" do
let(:options) { { cmd: "rspec", cmd_additional_args: "-f progress" } }

it "uses them" do
expect(command).to match %r{-f progress}
end
end
end

end