mirror of https://github.com/sbt/sbt.git
Cleanup TaskNegSpec
This commit is contained in:
parent
7b11729f8c
commit
621ad2b553
|
|
@ -7,15 +7,19 @@
|
||||||
|
|
||||||
package sbt.std.neg
|
package sbt.std.neg
|
||||||
|
|
||||||
|
import scala.tools.reflect.ToolBoxError
|
||||||
|
|
||||||
import org.scalatest.FunSuite
|
import org.scalatest.FunSuite
|
||||||
|
|
||||||
import sbt.std.TaskLinterDSLFeedback
|
import sbt.std.TaskLinterDSLFeedback
|
||||||
import sbt.std.TestUtil._
|
import sbt.std.TestUtil._
|
||||||
|
|
||||||
class TaskNegSpec extends FunSuite {
|
class TaskNegSpec extends FunSuite {
|
||||||
import tools.reflect.ToolBoxError
|
def expectError(
|
||||||
def expectError(errorSnippet: String,
|
errorSnippet: String,
|
||||||
compileOptions: String = "",
|
compileOptions: String = "",
|
||||||
baseCompileOptions: String = s"-cp $toolboxClasspath")(code: String) = {
|
baseCompileOptions: String = s"-cp $toolboxClasspath",
|
||||||
|
)(code: String) = {
|
||||||
val errorMessage = intercept[ToolBoxError] {
|
val errorMessage = intercept[ToolBoxError] {
|
||||||
eval(code, s"$compileOptions $baseCompileOptions")
|
eval(code, s"$compileOptions $baseCompileOptions")
|
||||||
println(s"Test failed -- compilation was successful! Expected:\n$errorSnippet")
|
println(s"Test failed -- compilation was successful! Expected:\n$errorSnippet")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue