Just a heads up to people about a Scala bug (at least in 2.9.2) that might affect you if you're using Around/Before scopes with named arguments. Here's the bug:
Here's an example scope that could cause a problem:
abstract class MyAround(a: Int = 1, b: Int = 2) extends Around with Scope {
def around[T](t: => T)(implicit evidence: (T) => Result) = {
// do some init with a and b
t
// tear down
}
}
And some code that would be broken by this:
"something" in new MyAround(b = 3) {
// At this point, the around won't have been run
}
The work around is to always supply the arguments to the around in the order they are defined, which means you can't miss any, so in the above example I would always have to supply a value for a if I wanted to supply a value for b.