From b254ec3d727e21c801e490c7a9d8a51cd038dd7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Krzewski?= Date: Mon, 10 Sep 2012 01:50:39 +0200 Subject: [PATCH 1/5] Use scala 2.10.0-M7 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e63bd33b..fe1b4ab6 100644 --- a/pom.xml +++ b/pom.xml @@ -37,7 +37,7 @@ scalamd scm:git:ssh://git@github.com:chirino/scalamd.git - 2.8.1 + 2.10.0-M7 2.15.0 2.4.3 2.3.4 From 3ae7c3e7eda14aeb8d010f267d66864d07f68cd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Krzewski?= Date: Mon, 10 Sep 2012 01:52:14 +0200 Subject: [PATCH 2/5] Use net.alchim31.maven:scala-maven-plugin which is now the actively developed version. --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index fe1b4ab6..9d279144 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,7 @@ scm:git:ssh://git@github.com:chirino/scalamd.git 2.10.0-M7 - 2.15.0 + 3.1.0 2.4.3 2.3.4 @@ -126,9 +126,9 @@ - org.scala-tools - maven-scala-plugin - ${maven-scala-plugin-version} + net.alchim31.maven + scala-maven-plugin + ${scala-maven-plugin-version} From c26837dac6251897d36c1aef75393492cfc5e4b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Krzewski?= Date: Mon, 10 Sep 2012 01:53:53 +0200 Subject: [PATCH 3/5] Use specs2 as specs do not support Scala 2.10 --- pom.xml | 6 +++--- src/test/scala/test.scala | 22 ++++++++++------------ 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/pom.xml b/pom.xml index 9d279144..ef6d534a 100644 --- a/pom.xml +++ b/pom.xml @@ -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 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 } From 6d4b4cb367fb9ef48694cddca96385858523091c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Krzewski?= Date: Mon, 10 Sep 2012 01:55:26 +0200 Subject: [PATCH 4/5] Use dedicated specs2 plugin to run the tests instead of surefire. 0.3.1-SNAPSHOT version that works with Scala 2.10 can be found in my fork: https://github.com/rkrzewski/maven-specs2-plugin --- pom.xml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pom.xml b/pom.xml index ef6d534a..b5051412 100644 --- a/pom.xml +++ b/pom.xml @@ -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.3.1-SNAPSHOT + + + test-specs2 + test + + run-specs + + + From 03ded3473e657bbe90e105b028b996ad79f4c523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Krzewski?= Date: Wed, 19 Sep 2012 22:36:40 +0200 Subject: [PATCH 5/5] Use newly released version of maven-specs2-plugin --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b5051412..9c0f24f6 100644 --- a/pom.xml +++ b/pom.xml @@ -153,7 +153,7 @@ com.mmakowski maven-specs2-plugin - 0.3.1-SNAPSHOT + 0.4.0-RC1 test-specs2