fix tests for ignoring scala by default

refs #20
This commit is contained in:
Johannes Rudolph 2012-10-24 11:31:21 +02:00
parent 81a204fe08
commit 6119663e48
6 changed files with 32 additions and 2 deletions

View File

@ -0,0 +1,29 @@
import net.virtualvoid.sbt.graph.Plugin._
graphSettings
scalaVersion := "2.9.2"
libraryDependencies ++= Seq(
"org.slf4j" % "slf4j-api" % "1.7.2",
"ch.qos.logback" % "logback-classic" % "1.0.7",
"com.typesafe.akka" % "akka-actor" % "2.0.3")
TaskKey[Unit]("check") <<= (ivyReport in Test, asciiTree in Test) map { (report, graph) =>
def sanitize(str: String): String = str.split('\n').drop(1).map(_.trim).mkString("\n")
val expectedGraph =
"""default:default-e95e05_2.9.2:0.1-SNAPSHOT [S]
| +-ch.qos.logback:logback-classic:1.0.7
| | +-ch.qos.logback:logback-core:1.0.7
| | +-org.slf4j:slf4j-api:1.6.6 (evicted by: 1.7.2)
| |
| +-com.typesafe.akka:akka-actor:2.0.3 [S]
| | +-com.typesafe:config:0.3.1
| |
| +-org.slf4j:slf4j-api:1.7.2
| """.stripMargin
IO.writeLines(file("/tmp/blib"), sanitize(graph).split("\n"))
IO.writeLines(file("/tmp/blub"), sanitize(expectedGraph).split("\n"))
require(sanitize(graph) == sanitize(expectedGraph), "Graph for report %s was '\n%s' but should have been '\n%s'" format (report, sanitize(graph), sanitize(expectedGraph)))
()
}

View File

@ -0,0 +1 @@
../../plugins.sbt

View File

@ -0,0 +1 @@
> check

View File

@ -0,0 +1 @@
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.7.0-RC3")

View File

@ -12,7 +12,6 @@ TaskKey[Unit]("check") <<= (ivyReport in Test, asciiTree in Test) map { (report,
val expectedGraph =
"""default:default-91180e_2.9.2:0.1-SNAPSHOT
| +-%sat.blub:blib:1.2.3 (error: not found)%s
| +-org.scala-lang:scala-library:2.9.2
| """.stripMargin.format(scala.Console.RED, scala.Console.RESET)
require(sanitize(graph) == sanitize(expectedGraph), "Graph for report %s was '\n%s' but should have been '\n%s'" format (report, sanitize(graph), sanitize(expectedGraph)))
()

View File

@ -1 +0,0 @@
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.6.1-SNAPSHOT")