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
refactor: Convert to assert_fs/assert_cmd #465
Conversation
tests/cli.rs
Outdated
.unwrap() | ||
.assert() | ||
.failure() | ||
.stderr(&predicate::str::contains("requires a subcommand").from_utf8()); |
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.
I should add an IntoOutput
that automatically converts str
predicates.
assert_dirs_eq(&destination, &target); | ||
let expected = format!("tests/target/{}", name); | ||
let expected_path = Path::new(&expected); | ||
assert_dirs_eq(&destination, expected_path); |
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.
Replacing our custom dir-diffing is assert-rs/predicates-rs#33
tests/cli.rs
Outdated
.current_dir(project_root.path()) | ||
.assert() | ||
.success() | ||
.stdout(&predicate::str::is_empty().from_utf8()) |
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.
Can't move forward with this until assert-rs/predicates-rs#7
The tests are now operating in a more standard use case thanks to the ability to easily setup. The are running in the CWD rather than all the paths artifically being set. Fixes cobalt-org#381
This is a test case for assert_fs / assert_cmd to identify areas to improve the API