Skip to content
This repository was archived by the owner on Dec 29, 2021. It is now read-only.

Make Assert::command and with_args take AsRef<OsStr> args #59

Closed
luser opened this issue Oct 25, 2017 · 2 comments
Closed

Make Assert::command and with_args take AsRef<OsStr> args #59

luser opened this issue Oct 25, 2017 · 2 comments

Comments

@luser
Copy link

luser commented Oct 25, 2017

First off, I just learned about assert_cli today and I'm excited to start using it!

All of the methods on std::process:Command for the executable name and commandline arguments take T: AsRef<OsStr>, so you can pass &str but also &Path and other useful things. It would be nice if Assert::command and Assert::with_args took the same type of arguments so that users could pass in a larger variety of types.

Specifically, I have the path to the executable I want to run as a PathBuf, so I can't pass it directly.

This will require Assert to store cmd as Vec<OsString> instead of Vec<String>, but it shouldn't cause any issues.

@epage
Copy link
Collaborator

epage commented Oct 25, 2017

Thanks for the feedback!

I agree that it'd be a good thing for us to make the API more accepting of different string types, much like what was done with Environment.

@killercup
Copy link
Collaborator

Yep, we should take AsRef<OsStr>!

epage added a commit to epage/assert_cli that referenced this issue Oct 27, 2017
epage added a commit to epage/assert_cli that referenced this issue Oct 27, 2017
epage added a commit to epage/assert_cli that referenced this issue Oct 27, 2017
epage added a commit to epage/assert_cli that referenced this issue Oct 27, 2017
bors bot added a commit that referenced this issue Oct 27, 2017
73: feat: Support OsStr, Path, etc for args r=epage a=epage

Fixes #59
@bors bors bot closed this as completed in #73 Oct 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants