Skip to content
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

Merged
merged 1 commit into from Aug 2, 2018
Merged

Conversation

epage
Copy link
Member

@epage epage commented Jun 13, 2018

This is a test case for assert_fs / assert_cmd to identify areas to improve the API

tests/cli.rs Outdated
.unwrap()
.assert()
.failure()
.stderr(&predicate::str::contains("requires a subcommand").from_utf8());
Copy link
Member Author

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.

See assert-rs/assert_cmd#2

assert_dirs_eq(&destination, &target);
let expected = format!("tests/target/{}", name);
let expected_path = Path::new(&expected);
assert_dirs_eq(&destination, expected_path);
Copy link
Member Author

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())
Copy link
Member Author

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

@epage epage changed the title WIP refactor: Convert to assert_fs/assert_cmd refactor: Convert to assert_fs/assert_cmd Aug 2, 2018
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
@epage epage merged commit 938adaf into cobalt-org:master Aug 2, 2018
@epage epage deleted the assert branch August 2, 2018 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant