Skip to content
This repository has been archived by the owner on Dec 29, 2021. It is now read-only.

Future of assert_cli #41

Open
killercup opened this issue Sep 25, 2017 · 19 comments
Open

Future of assert_cli #41

killercup opened this issue Sep 25, 2017 · 19 comments
Labels

Comments

@killercup
Copy link
Collaborator

killercup commented Sep 25, 2017

@epage asked in #40 (comment):

I'm curious, what do you see needing done before moving this to 1.0? While I should get back to my regularly schedule project, I would like to also help work towards more crates hitting 1.0.

Good question! I'd like to make the arg parsing a bit leaner (cf. #25 and #32) and maybe improve the error output (#17, #18, #30).

My general goal is to make a library that makes writing tests like these easy and fun. It'll probably involve generating some test boilerplate code, and I'm not entirely sure what I want that API to look like. I'm not even sure if that's in scope for assert_cli. What do you think?

EDIT

The building blocks for assert_cli 1.0 are

@epage

This comment has been minimized.

@killercup

This comment has been minimized.

@killercup
Copy link
Collaborator Author

Pinging some people who used assert_cli in their projects (found using Github search):

We are thinking about doing a 1.0 release and would love to hear your opinion on the crate and ideas for its future!

  • @livioribeiro who used it for cargo-readme integration tests
  • @bjgill who updated cargo-edit to assert_cli 0.4
  • @mattgathu who quite recently used assert_cli in rget
  • @jxson who uses it in some tests of to-directory

@mattgathu

This comment has been minimized.

@mattgathu
Copy link

About future ideas, I have been wondering how feasible it is to test for colored output?

If my CLI binary prints out colored text, can I test this?

What are your thoughts on this.

@epage

This comment has been minimized.

@epage
Copy link
Collaborator

epage commented Oct 2, 2017

About future ideas, I have been wondering how feasible it is to test for colored output? If my CLI binary prints out colored text, can I test this?

Most programs detect if they are outputting to a console and don't print color if they are. Some have a "force color" option.

So either we'd need to figure out how to fake being a console or clients need to have a force color option and set it.

When forced, I assume color just shows up in stdout as weird characters. Can you just manually enter those characters in to test it? Do you have a proposal for what an API might look like for more advanced color testing?

@epage epage mentioned this issue Oct 5, 2017
@epage

This comment has been minimized.

@killercup

This comment has been minimized.

@Freyskeyd

This comment has been minimized.

@epage

This comment has been minimized.

@Freyskeyd

This comment has been minimized.

@epage

This comment has been minimized.

@epage

This comment has been minimized.

@killercup

This comment has been minimized.

@epage

This comment has been minimized.

@epage

This comment has been minimized.

@epage
Copy link
Collaborator

epage commented May 29, 2018

We've started the major shift to assert_cli 1.0. assert_cmd is the spiritual successor to what assert_cli today. We plan to turn assert_cli into a higher level CLI testing crate like waltz tests.

The building blocks for assert_cli 1.0 are

The bad: it will probably take longer to stablize assert_cli because we need to re-evaluate the design and play with ideas

The good: the smaller pieces should be a lot easier to stablize.

@epage
Copy link
Collaborator

epage commented May 31, 2018

Started looking at how others test CLIs and for python, I only found https://bitheap.org/cram/

mssun pushed a commit to mesalock-linux/mesabox that referenced this issue Jul 13, 2018
@epage epage pinned this issue Nov 13, 2020
@epage epage changed the title Version 1.0 Future of assert_cli Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants