Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Phoned in some tests. Updated the docs again.
- Loading branch information
Showing
4 changed files
with
124 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package org.improving | ||
|
||
import scala.tools.nsc.io._ | ||
import org.specs._ | ||
|
||
object SbtRunnerTest extends Specification { | ||
val scripts = { | ||
import Predef._ | ||
List[String]( | ||
"""|sbt -sbt-create -sbt-snapshot -210 | ||
|sbt update | ||
|sbt about | ||
""", | ||
"""|sbt -sbt-create -sbt-snapshot -29 | ||
|sbt update | ||
|sbt version | ||
""", | ||
"""|sbt -sbt-create -sbt-version 0.7.7 -28 | ||
|sbt help | ||
|sbt -h | ||
""" | ||
) map (_.trim.stripMargin.lines.toList) | ||
} | ||
|
||
val singles = """ | ||
sbt -v -d -no-colors update package | ||
sbt -verbose -210 -debug -ivy /tmp update | ||
""".trim.lines | ||
|
||
import scala.sys.process._ | ||
|
||
def sbtProjectLines(lines: List[String]) = { | ||
println("Running: " + lines.mkString(", ")) | ||
|
||
val dir = Directory.makeTemp("sbt-runner-test").jfile | ||
val result = lines map (x => Process(x, dir)) reduceLeft (_ #&& _) ! ; | ||
|
||
result == 0 | ||
} | ||
def sbtProjectLine(line: String) = | ||
sbtProjectLines(List("sbt -sbt-create version", line)) | ||
|
||
"Sbt Runner" should { | ||
"deal with lots of different command lines" in { | ||
singles foreach (x => sbtProjectLine(x) mustEqual true) | ||
} | ||
"handle various command sequences" in { | ||
scripts foreach (xs => sbtProjectLines(xs) mustEqual true) | ||
} | ||
} | ||
} |