Go code (golang) that provides tools for testing that your command line tool will behave as you intend.
Features include:
- Check if command was successful or failed
- Assertions on stdout
- Execution of interactive commands
See it in action:
package yours
import (
"testing"
. "github.com/SteffiPeTaffy/clinium"
)
func Test_YourAwesomeTest(t *testing.T) {
myCli := NewCli(t, "../foo/bar/myCli")
myCli.Expect("foo", "--bar", "baz").
ToSucceed("This should work").
ToNotContain("banana")
}
We support the three major Go versions, which are 1.11, 1.12, and 1.13 at the moment.
Please feel free to submit issues, fork the repository and send pull requests!
When submitting an issue, we ask that you please include a complete test function that demonstrates the issue. Extra credit for those using CLInium to write the test code that demonstrates it.
This project is licensed under the terms of the MIT license.