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

Assert a file matches a fixture on disk #32

Closed
epage opened this issue Apr 27, 2018 · 4 comments · Fixed by #43
Closed

Assert a file matches a fixture on disk #32

epage opened this issue Apr 27, 2018 · 4 comments · Fixed by #43
Labels
enhancement Improve the expected
Milestone

Comments

@epage
Copy link
Contributor

epage commented Apr 27, 2018

Things to assert

  • file type
  • file content

others?

@epage epage added the enhancement Improve the expected label Apr 27, 2018
@epage epage added this to the 0.5 milestone Apr 27, 2018
@epage epage changed the title Assert a file matches a fixture version Assert a file matches a fixture on disk May 9, 2018
@epage
Copy link
Contributor Author

epage commented May 29, 2018

Possible Requirements

  • Doesn't need to solve everything because we have from_path for people to do complex predicates
  • Defaults to loading as [u8] and checking equality
    • Handle large binary files (chunking) (from dir-diff issues)
  • Optionally enable text diffing
    • Normalize new lines (from dir-diff issues)
    • When messages are supported, show line diff (or word diff?)
  • Scale API for diffing directories?

@epage
Copy link
Contributor Author

epage commented May 29, 2018

Possible API

  • eq_file(path): BinaryFilePredicate
  • eq_file(path).str(): StrFilePredicate
    • eq_file(path).str().normalize_eol(yes: bool)

@epage
Copy link
Contributor Author

epage commented May 29, 2018

Background: we'll also want a directory matches a directory on disk

  • What can we reuse about the API, if any?

What if the API was instead eq_file(path, flags) where flags is a bitfield with the following

  • STR
  • NORMALIZE_EOL

@epage
Copy link
Contributor Author

epage commented May 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improve the expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant