Does Play framework 2.4.x support Spock BDD unit test?

96 views
Skip to first unread message

Jiafan Zhou

unread,
Feb 17, 2018, 6:39:29 PM2/17/18
to Play framework dev
Hi,

I've recently started to work with a Play framework based project (version 2.4.x), and being a BDD developer I love the Spock Unit Test framework. It works perfectly with Java/Maven.

However, it seems that I failed to find anyway to make Spock work for Play framework, Scala/sbt.

Have looked at the below link:
https://groups.google.com/forum/#!searchin/spockframework/scala%7Csort:date/spockframework/NsmRcNbmU6A/hVMOO7y-tSAJ

Is it possible to use Spock framework for Play framework?

Best Regards,
Jiafan

James Roper

unread,
Feb 18, 2018, 6:35:52 PM2/18/18
to Jiafan Zhou, Play framework dev
According to the Spock website:


Spock provides a JUnit runner, and this is what allows it to be compatible with IDEs and build tools without explicit support for Spock in those tools. So, presumably, to run Spock tests from sbt, you'll need junit support. Simply add:

"com.novocode" % "junit-interface" % "0.11" % "test"

To your projects library dependencies, and you'll have JUnit support in sbt. Then, I'm guessing, Spock should just work, but I haven't tried it so I got no idea. For more info on the junit support in sbt:


--
You received this message because you are subscribed to the Google Groups "Play framework dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework-dev+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
James Roper
Senior Octonaut

Lightbend – Build reactive apps!
Twitter: @jroper

Reply all
Reply to author
Forward
0 new messages