diff --git a/pom.xml b/pom.xml index e63bd33b..3912fc18 100644 --- a/pom.xml +++ b/pom.xml @@ -37,9 +37,9 @@ scalamd scm:git:ssh://git@github.com:chirino/scalamd.git - 2.8.1 - 2.15.0 - 2.4.3 + 2.10.0-RC2 + 3.1.0 + 2.12.4 2.3.4 @@ -80,9 +80,9 @@ test - org.scala-tools.testing - specs_2.8.1 - 1.6.6 + org.specs2 + specs2_${scala-version} + 1.12.2 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} @@ -162,6 +162,9 @@ false true false + + **/*Spec.java + diff --git a/src/test/scala/test.scala b/src/test/scala/test.scala index 8668775b..5aa992f5 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 { +class 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 }