I'm continuing my Stack-Overflow-Driven Programming of a testing DSL - thanks to all who have contributed so far!
At the moment my DSL reads like this
scenario("Incorrect password") {
given("user visits", the[AdminHomePage])
then(the[SignInPage], "is displayed")
when("username", "admin", "and password", "wrongpassword", "are entered")
then(the[SignInPage], "is displayed")
and("Error message is", "Sign in failed")
}
given, when and then are methods that take Any
, so when called like this they are passed a tuple of the arguments - Why and how is Scala treating a tuple specially when calling a one arg function? .
Ideally I'd drop the commas, so that it reads much nicer, with just spaces separating the tokens
scenario("Incorrect password") {
given("user visits" the[AdminHomePage])
then(the[SignInPage] "is displayed")
when("username" "admin" "and password" "wrongpassword" "are entered")
then(the[SignInPage] "is displayed")
and("Error message is" "Sign in failed")
}
Can anyone think of any technique that would let me achieve this goal, or is it going too far for an internal DSL?