scala - Executing Specification with Scope does not call sub tests -


given following specification

class config2spec extends org.specs2.mutable.specification {   "reading different versions of config should work" in new ascope  {     "buffer should contain proper config" in {       buffer(0).content should have size 1     }    "buffer should have fresh config" in {       buffer should have size 2       buffer(1).content should have size 2     }  }   trait ascope extends scope {    val buffer : mutable.buffer[config] = mutable.buffer()    val cfg1 = "l1"     val cfg2 = "l1\nl2"     val file = "testcfg"    val path = paths.get(system.getproperty("user.home"), "test")    files.createdirectories(path)    val of = observablefile(path, file)    files.write(of.aspath, cfg1.getbytes("utf-8"))    buffer += configreader.read(file, {cfg => buffer += cfg})    files.write(of.aspath, cfg2.getbytes("utf-8"))    thread.sleep(1000)   } } 

the 2 examples "buffer should contain proper config" , "buffer should have fresh config" never called. have changed working?

scopes can used on "terminal" examples:

class config2spec extends org.specs2.mutable.specification {   "reading different versions of config should work" in {     "buffer should contain proper config" in new ascope {       === 0       += 1     }     "buffer should have fresh config" in new ascope {       === 0       += 1    }  }    trait ascope extends scope {     var = 0   } } 

Comments