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

Is it possible to write a multiline file in .trycmd tests? #208

Open
Rigellute opened this issue Apr 15, 2023 · 2 comments
Open

Is it possible to write a multiline file in .trycmd tests? #208

Rigellute opened this issue Apr 15, 2023 · 2 comments
Labels
A-trycmd Area: trycmd package enhancement Improve the expected

Comments

@Rigellute
Copy link

I'd like to be able to create multiline files from within the trycmd blocks to serve as test fixtures. Is it possible?
I'm thinking something like this (pseudo code):

write todos.txt = """
- [x] Wash the dishes
- [ ] Mow lawn
"""
$ mytodos -f todos.txt
Mow lawn

Would be awesome if you could assign stdin like this too:

stdin = """
- [x] Wash the dishes
- [ ] Mow lawn
"""
$ mytodos -f -
Mow lawn
@epage
Copy link
Contributor

epage commented Apr 17, 2023

At this time, no.

We do support <stem>.in/ directories for runnin your trycmd files within. I'm a bit hesitant to add more complexity to the trycmd file syntax and we'd need a good reason why .in/ directories wouldn't work

@epage epage added enhancement Improve the expected A-trycmd labels Apr 17, 2023
@Rigellute
Copy link
Author

@epage totally makes sense. The *.in/ directories are working well.
And thank you for this amazing crate, it's making testing my cli a joy!

@settings settings bot removed the A-trycmd label Aug 14, 2023
@epage epage added the A-trycmd Area: trycmd package label Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-trycmd Area: trycmd package enhancement Improve the expected
Projects
None yet
Development

No branches or pull requests

2 participants