Created
October 12, 2019 20:44
-
-
Save etorreborre/7d9077698f162626e6bb7c70aad4effe to your computer and use it in GitHub Desktop.
Specs2 command line arguments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.specs2.main.CommandLine | |
// run from sbt with | |
// | |
// sbt> testOnly *ArgsSpec* | |
// sbt> testOnly *ArgsSpec* -- isOk | |
// sbt> testOnly *ArgsSpec* -- !isOk | |
// | |
// and see the difference | |
class ArgsSpec(args: CommandLine) extends mutable.Specification { | |
"This example is controlled from the command line" in { | |
if (args.isSet("isOk")) 1 must_== 1 | |
else 1 must_== 2 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment