GithubHelp home page GithubHelp logo

Comments (11)

epage avatar epage commented on July 30, 2024

Thats a really great idea!

For stdin, its just a matter of coming up with the name.

For stdout, stderr, the challenge is we won't know if its intended to be binary or str (this matters for the new feature I'm writing). I wonder if its best to l leave it as stdout(predicte::path::eq_file(path))

from assert_cmd.

epage avatar epage commented on July 30, 2024

Also, something else for us to consider with stdin is we might want to support chunking in case someone is testing a really large file.

from assert_cmd.

mssun avatar mssun commented on July 30, 2024

Thanks @epage, I didn't notice the usage of stdout(predicte::path::eq_file(path)) actually. I think it's OK for me to use predicates.

In terms of the name, how about with_fixture_stdin?

from assert_cmd.

epage avatar epage commented on July 30, 2024

Thanks @epage, I didn't notice the usage of stdout(predicte::path::eq_file(path)) actually. I think it's OK for me to use predicates.

I've gone ahead and removed stdout/stderr from this to make our narrowed focus clear.

In terms of the name, how about with_fixture_stdin?

imo whether you use a file or in-memory string, both would be considered fixtures, right?

So one option is with_stdin_file? Another options is with_stdin().from_bytes("Hello World") / with_stdin().from_path("./hello.txt").

from assert_cmd.

mssun avatar mssun commented on July 30, 2024

I've gone ahead and removed stdout/stderr from this to make our narrowed focus clear.

Yes, you are right.

I think with_stdin().from_bytes("Hello World") / with_stdin().from_path("./hello.txt") are more readable.

from assert_cmd.

epage avatar epage commented on July 30, 2024

Publishing v0.6.0 with this fix. Sorry for the delay.

from assert_cmd.

mssun avatar mssun commented on July 30, 2024

I guess I cannot use .stdout(predicate::path::eq_file(Path::new("filename")) right now?

I'm a little confused about FileContentPredicate, BinaryFilePredicate, and StrFilePredicate. Anyway, can you give me an example of how to compare content in a fixture file with the stdout (in binary or in str). Thank you so much!

from assert_cmd.

epage avatar epage commented on July 30, 2024

Yeah, I realized that on closer inspection and opened assert-rs/predicates-rs#56

My plan has been to finish assert-rs/predicates-rs#7 first because I've started it and it is more invasive but it is larger and controversial, so it might take longer to get in.

from assert_cmd.

mssun avatar mssun commented on July 30, 2024

I see. Thank you @epage. Can you ping me if it's ready to use?

from assert_cmd.

epage avatar epage commented on July 30, 2024

Just to check, is that another blocking issue for you?

I see. Thank you @epage. Can you ping me if it's ready to use?

Alternatively, you could subscribe to the issue?

from assert_cmd.

mssun avatar mssun commented on July 30, 2024

Yes, my expectation is to pipe in fixture files and compare stdout with fixture files. I have subscribed these issues you mentioned. Thanks.

from assert_cmd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.