-
Notifications
You must be signed in to change notification settings - Fork 76
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
How Do I Write An Integration Test For Inquire (Confirm)? #107
Comments
JimLynchCodes
changed the title
How Do I Write An Integration Test For Confirm?
How Do I Write An Integration Test For Inquire (Confirm)?
Mar 20, 2023
Note, I also asked this on SO: https://stackoverflow.com/questions/75816676/how-can-i-write-integration-tests-for-a-rust-cli-tools-that-use-inquire |
I think this issue may be related… not sure how exactly I use this Key struct to simulate hitting the enter key in my test though. 🤔 |
Working on making this possible, tracked on #71 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a little cli tool that basically asks the user a yes or no question and then prints a response to the console.
Here is what I currently have:
This always works, and I don't really know how to do any assertions...
Is it possible for me to pass some
.arg("--yes")
or.arg("--no")
that will simulate a user responding to the prompt?Also, is there any way for me to assert that the proper question, prompt and response text is output in the console?
Thanks! 🙏
The text was updated successfully, but these errors were encountered: