gnormal / gnorm

A database-first code generator for any language
https://gnorm.org
Other
487 stars 40 forks source link

CLI Tests #4

Open natefinch opened 7 years ago

natefinch commented 7 years ago

Tests to ensure the CLI flag parsing does all the right stuff

gernest commented 6 years ago

If flags parsing is handled by cobra, I thought the testing was supposed to be done there! I haven't used cobra that much, but looking at the cli/commands.go there is nothing much to test, unless if i missed something.

natefinch commented 6 years ago

It's not parsing the command line so much as ensuring that the flags behave properly, etc. Like, there was a time when I broke the verbose output.

gernest commented 6 years ago

Oh! That is sad, I take these things for granted when using commandline app building libs!I'm a big fan of urfave/cli . It is tricky to test though, can't remember the trick used by os/exec as it might require running the binary to test it.