-
Notifications
You must be signed in to change notification settings - Fork 9
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
What is needed for 1.0? #46
Comments
@Valodim, @glehmann, @vincentdephily, and @mssun: you all have participated in some issues. Could you provide input on this? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
My main usage of I use I would use If I try to bump to v0.11, I get a bunch of:
errors. I realize now, I should probably submit an issue for this, but it is an example of a common pattern or option I implement for my tests. Maybe I am just missing something on how to use temporary directories in relation to the The above anecdote highlights an inconsistency between the two sibling crates: If going with the composition-themed implementation, then methods and functions to upcast/downcast to the inner type, which is rust-like, would be greatly appreciated. Examples of using both crates together would be helpful, too. |
@volks73 thank you for taking the time to write up that feedback!
So first, a workaround. You can create a As I'll mention below, I made the assumption that custom prefix/suffix and other functionality on the builder wasn't needed within the confines of testing. I assumed people would just create their needed directory or file within the temp dir. It appears I was wrong and I want to better understand the requirements going into how I was wrong so I can ensure any future evolution meets your needs. Looking at the tests, it seems the tests do a Is there a reason that this is done rather than passing
(So leaving this background for last since it doesn't really help you.) Yeah, I can see the divergent API styles for I switched to newtypes in #41. I wish I had recorded my reasons. My guesses for how the two APis ended up diverging:
|
It was a while ago, and like you, I wish I had made better notes on my reasons. I can think of three possibilities:
I do wonder how common it is to create and test cargo subcommands within the Rust CLI community? My usage of The reasons for the divergence between On a side note, I am just now seeing your comments to my gist on adding some STDIN test functionality to |
Thanks for the reply!
Thats strange. So far I've not seen this.
I'm slowly adding tests to btw once I finish up the bare minimum for running cargo-release in a workspace, I plan to create a |
I went thru my use of assert_fs, but nothings sticks out anymore. I always start with let mut sb = String::new();
let f = tmpdir.child(c.file);
let path = f.path();
File::open(path).expect(&format!("Couldn't open {:?}", path))
.read_to_string(&mut sb)
.expect(&format!("Couldn't read {:?} as utf8", path)); which would be nice to a a convenience function for ( I also often test the file content with a regexp, but I suppose I should direct such requests at the I actually have more wrappers around |
@vincentdephily thanks for taking the time to look back and write up your thoughts!
What reason are you reading the string for that isn't handled by predicates?
Yes, predicates already supports regex.
Oh wow, sounds like some fun tests you've got there :). Even if you don't take the time to upstream, I'd be interested in you recording your workflow on assert-rs/assert_cmd#74 so we can see if its something that fits within assert_cmd and we can take on upstreaming it. |
This required changing the implementation of creating test projects. The `.tmp` prefix can be used in Windows but the cargo project name cannot. Thus, the `--name <NAME>` option needed to be used for creating a test package because the `TempDir` type from the assert_fs package does not support the tempfile TempDir builder or changing the prefix in newer versions. See Issues [#46] and [#48] from the `assert_fs` project for more information. [#46]: assert-rs/assert_fs#46 [#48]: assert-rs/assert_fs#48
With #56's breaking change in, I don't think there is anything to hold us back from a 1.0. While the documentation improvements would be nice, we shouldn't wait for perfection. |
Collecting feedback or assert_fs. Please post even if you think it might not be needed for 1.0 so we can try to get the big picture of uses, challenges, etc. We're also looking at including experience reports in the 1.0 announcement blog post.
Preferably, please update to the latest version first but don't let upgrading stop you from providing feedback
To help spur feedback, consider these questions
Summary
Areas to improve
Successes
@volks73
The text was updated successfully, but these errors were encountered: