You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 29, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 29, 2021. It is now read-only.
One thing in favor of accepting predicates as parameters is that someone wanted to pass multiple predicates at once which is more of an issue with contains and negated contains/is and not is.
But! At that point me might as well do .stderr(|x: OutputAssertThingy| -> bool { x.is("bar") || (x.contains("baz") || !x.is("bazinga")) }) to not reinvent boolean expressions. Which I think was something someone was asking for in another issue anyway (cf. #57).
I think there is still value in specialized predicates for better error reporting. We could just use From to auto-convert a Fn into one of the predicates.
Activity
epage commentedon Oct 27, 2017
RE Accepting predicates (from #41)
One thing in favor of accepting predicates as parameters is that someone wanted to pass multiple predicates at once which is more of an issue with contains and negated contains/is and not is.
I think there is still value in specialized predicates for better error reporting. We could just use From to auto-convert a Fn into one of the predicates.
killercup commentedon Oct 27, 2017
Error reporting is a good point! We should aim for nice errors, as that is what people are using the crate for.
I didn't specify what
OutputAssertThingyis in that quote… so maybe we can try to write a type that overloads boolean operators in a very clever way?fix(output): Re-work API to work with rustfmt
fix(output): Re-work API to work with rustfmt
fix(output): Re-work API to work with rustfmt
fix(output): Re-work API to work with rustfmt
fix(output): Re-work API to work with rustfmt
epage commentedon Apr 7, 2018
In addition to the existing PR exploring this, #98 would also possibly resolve this.
epage commentedon May 29, 2018
Addressed in assert_cmd
https://github.com/assert-rs/assert_cmd
assert_cli is going to morph into a wider-focused tool, including things like assert_fs. See #41