diff --git a/pom.xml b/pom.xml index e63bd33b..9c0f24f6 100644 --- a/pom.xml +++ b/pom.xml @@ -37,8 +37,8 @@ scalamd scm:git:ssh://git@github.com:chirino/scalamd.git - 2.8.1 - 2.15.0 + 2.10.0-M7 + 3.1.0 2.4.3 2.3.4 @@ -80,9 +80,9 @@ test - org.scala-tools.testing - specs_2.8.1 - 1.6.6 + org.specs2 + specs2_2.10.0-M7 + 1.12.1.1 test @@ -126,9 +126,9 @@ - org.scala-tools - maven-scala-plugin - ${maven-scala-plugin-version} + net.alchim31.maven + scala-maven-plugin + ${scala-maven-plugin-version} @@ -151,18 +151,18 @@ - org.apache.maven.plugins - maven-surefire-plugin - ${maven-surefire-plugin-version} - - - - false - - false - true - false - + com.mmakowski + maven-specs2-plugin + 0.4.0-RC1 + + + test-specs2 + test + + run-specs + + + diff --git a/src/test/scala/test.scala b/src/test/scala/test.scala index 8668775b..398ad26a 100644 --- a/src/test/scala/test.scala +++ b/src/test/scala/test.scala @@ -3,20 +3,19 @@ */ package org.fusesource.scalamd.test -import org.specs.runner.JUnit4 -import org.specs.Specification import java.io.File import org.fusesource.scalamd.Markdown import org.apache.commons.io.FileUtils import org.apache.commons.lang.StringUtils -import org.specs.matcher.Matcher +import org.specs2.mutable._ +import org.specs2.matcher.Expectable +import org.specs2.matcher.Matcher -class SpecsTest extends JUnit4(MarkdownSpec) - -object MarkdownSpec extends Specification { +object MarkdownSpec extends SpecificationWithJUnit { val beFine = new Matcher[String] { - def apply(name: => String) = { + def apply[S <: String](s: Expectable[S]) = { + val name = s.value val textFile = new File(this.getClass.getResource("/" + name + ".text").toURI) val htmlFile = new File(this.getClass.getResource("/" + name + ".html").toURI) val text = Markdown(FileUtils.readFileToString(textFile, "UTF-8")).trim @@ -24,15 +23,14 @@ object MarkdownSpec extends Specification { val html = FileUtils.readFileToString(htmlFile, "UTF-8").trim val diffIndex = StringUtils.indexOfDifference(text, html) val diff = StringUtils.difference(text, html) - (diffIndex == -1, + result(diffIndex == -1, "\"" + name + "\" is fine", - "\"" + name + "\" fails at " + diffIndex + ": " + StringUtils.abbreviate(diff, 32)) + "\"" + name + "\" fails at " + diffIndex + ": " + StringUtils.abbreviate(diff, 32), + s) } } - def process = addToSusVerb("process") - - "MarkdownProcessor" should process { + "MarkdownProcessor" should { "Images" in { "Images" must beFine }