-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add Compound Parameters #340
Conversation
@stevendborrelli that TODO codeclimate is complaining about is the one that it'd be really helpful if you'd fill in |
{{< note title="Backwards arguments?" >}} | ||
Some of the utility functions (like `split` and `join`) seem to have their | ||
arguments backwards. This is to allow you to pipe values to them. For example, | ||
joining a list on strings is `{{paramList "x" | join "\n"}}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"list of strings"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops! I've fixed this in the latest push.
29ba605
to
10ddbd5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM other than a couple of small nits.
arguments backwards. This is to allow you to pipe values to them. For example, | ||
joining a list of strings is `{{paramList "x" | join "\n"}}` | ||
{{< /note >}} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a sentence or two here about what happens if I try to pipe a list of type int to a function like join that operates on a list of strings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The answer before: join fails because it's the wrong type. But that's just silly, since we don't have any way to do type conversions. So now it'll just stringify any arguments passed to it. See 7e65cc6
@@ -187,18 +203,18 @@ func newStub(returnVal interface{}) func(...string) (interface{}, error) { | |||
// RememberCalls takes a pointer to a list of strings, and an argument |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should update the comment to reflect that we no longer take an index, but do take a return type.
We're not going to add a ruby runtime to CI right now, and we'd need it now that the check_flags are corrected.
edd5a05
to
79b2ad9
Compare
See examples for more.
Fixes #110