Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Class:
- /** (Playframework 2.2 extension for use with Specs2)
- * Used to run specs within the context of a running application.
- *
- * @param app The fake application
- */
- abstract class WithApplication(val app: FakeApplication = FakeApplication()) extends Around with Scope {
- implicit def implicitApp = app
- override def around[T: AsResult](t: => T): Result = {
- Helpers.running(app)(AsResult.effectively(t))
- }
- }
- Use:
- "tests something" in new WithApplication() {
- //the test here
- }
- Question:
- Why isn't the test code between the braces executed immediately on instantiation? (It seems like it would be part of the constructor or something.) How is it assigned to a variable and executed in around. (Or is this even the right understanding of what happens?)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement