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 1 commit
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
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' } }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.


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

end