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

Conversation

benjie
Copy link
Contributor

@benjie benjie commented Jul 24, 2014

This patch gives a clean way of adding additional arguments at the end of the custom command (before the spec files are specified), useful for example if it was necessary to override one of the defaults.

The reason for this patch is to provide a simple hack to enable compatibility with zeus-parallel_tests (see sevos/zeus-parallel_tests#26) via these (or similar) options:

cmd: 'zeus parallel_rspec -o "',
cmd_additional_args: '"'

(parallel_rspec requires all rspec's options to be passed via its -o option.) Obviously this isn't very clean because of the assumption that none of the default options have quotes in, but it seems like an acceptable temporary hack that's useful in it's own regard?

A clean way of adding additional arguments at the end of the custom
command (before the spec files are specified), useful for example if it
was necessary to override one of the defaults.
@@ -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.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 94ecf83 on benjie:add-additional-args into 7df24a8 on guard:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 38f6007 on benjie:add-additional-args into 7df24a8 on guard:master.

@907th
Copy link
Contributor

907th commented Jul 24, 2014

@benjie Good. Please, add an usage example to README.

@benjie
Copy link
Contributor Author

benjie commented Jul 24, 2014

@907th Added to the "List of available options" - is that what you meant?

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 683e6c6 on benjie:add-additional-args into 7df24a8 on guard:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 683e6c6 on benjie:add-additional-args into 7df24a8 on guard:master.

907th pushed a commit that referenced this pull request Jul 24, 2014
Apply additional arguments to :cmd after defaults.
@907th 907th merged commit d042c45 into guard:master Jul 24, 2014
@907th
Copy link
Contributor

907th commented Jul 24, 2014

@benjie Yes, thanks!

@robert2d robert2d mentioned this pull request Nov 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants