Skip to content

Commit

Permalink
This now works for whatever reason (new sbt or new specs2). Re-enabling.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikko Koponen committed Jun 25, 2012
1 parent 4de4e81 commit 3921ec4
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/test/scala/reaktor/scct/report/BinaryReporterSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,21 @@ package reaktor.scct.report

import org.specs2.mutable._
import java.io.File
import reaktor.scct.CoveredBlockGenerator._
import org.specs2.specification.Scope

class BinaryReporterSpec extends Specification {
import reaktor.scct.CoveredBlockGenerator._

/*
For sbt-wierdness-reasons, this works in IDEA but fails on sbt 0.77 with classloading errors. Giving up.
*/

doBeforeSpec {
val f = new File(new File(System.getProperty("java.io.tmpdir", "/tmp")), BinaryReporter.dataFile)
if (f.exists()) f.delete()
}
"Readin and riting" in {
"Readin and riting" in new CleanEnv {
val tmp = new File(System.getProperty("java.io.tmpdir", "/tmp"))
new File(tmp, BinaryReporter.dataFile).exists() must beFalse
val projectData = ProjectData("myProject", new File("/baseDir"), new File("/sourceDir"), blocks(true, false))
BinaryReporter.report(projectData, tmp)
new File(tmp, BinaryReporter.dataFile).exists() must beTrue
println("Plaze: "+tmp.getAbsolutePath)
val result = BinaryReporter.read(new File(tmp, BinaryReporter.dataFile))
result.projectId mustEqual "myProject"
result.baseDir.getAbsolutePath mustEqual "/baseDir"
Expand All @@ -31,5 +27,8 @@ class BinaryReporterSpec extends Specification {
result.data(1).count mustEqual 0
}

*/
trait CleanEnv extends Scope {
val f = new File(new File(System.getProperty("java.io.tmpdir", "/tmp")), BinaryReporter.dataFile)
if (f.exists()) f.delete()
}
}

0 comments on commit 3921ec4

Please sign in to comment.