diff --git a/i18n/build.sbt b/i18n/build.sbt index bbcf912..2dbb742 100644 --- a/i18n/build.sbt +++ b/i18n/build.sbt @@ -12,5 +12,5 @@ scmInfo := Some(ScmInfo(browseUrl = new URL("https://github.com/albertpastrana/u connection = "scm:git:git@github.com:albertpastrana/uscala.git")) libraryDependencies ++= Seq( - "org.specs2" %% "specs2-core" % "3.8.6" % "test" + Dependencies.Specs2Core ) diff --git a/project/Dependencies.scala b/project/Dependencies.scala new file mode 100644 index 0000000..a9dd9a1 --- /dev/null +++ b/project/Dependencies.scala @@ -0,0 +1,13 @@ +import sbt._ + +object Dependencies { + + object Versions { + val Specs2 = "4.0.3" + } + + // Libraries + val Specs2Core = "org.specs2" %% "specs2-core" % Versions.Specs2 + val Specs2ScalaCheck = "org.specs2" %% "specs2-scalacheck" % Versions.Specs2 + +} diff --git a/resources/build.sbt b/resources/build.sbt index 89e687d..5827422 100644 --- a/resources/build.sbt +++ b/resources/build.sbt @@ -13,5 +13,5 @@ scmInfo := Some(ScmInfo(browseUrl = new URL("https://github.com/albertpastrana/u connection = "scm:git:git@github.com:albertpastrana/uscala.git")) libraryDependencies ++= Seq( - "org.specs2" %% "specs2-core" % "3.8.6" % "test" + Dependencies.Specs2Core ) diff --git a/result-async/build.sbt b/result-async/build.sbt index f804b89..85b2f02 100644 --- a/result-async/build.sbt +++ b/result-async/build.sbt @@ -14,6 +14,6 @@ scmInfo := Some(ScmInfo(browseUrl = new URL("https://github.com/albertpastrana/u connection = "scm:git:git@github.com:albertpastrana/uscala.git")) libraryDependencies ++= Seq( - "org.specs2" %% "specs2-core" % "3.8.6" % "test", - "org.specs2" %% "specs2-scalacheck" % "3.8.6" % "test" -) \ No newline at end of file + Dependencies.Specs2Core, + Dependencies.Specs2ScalaCheck +) diff --git a/result-async/src/test/scala/uscala/concurrent/result/AsyncResultSpec.scala b/result-async/src/test/scala/uscala/concurrent/result/AsyncResultSpec.scala index c16c741..ae5ecba 100644 --- a/result-async/src/test/scala/uscala/concurrent/result/AsyncResultSpec.scala +++ b/result-async/src/test/scala/uscala/concurrent/result/AsyncResultSpec.scala @@ -6,7 +6,6 @@ import org.scalacheck.{Arbitrary, Gen} import org.specs2.ScalaCheck import org.specs2.concurrent.ExecutionEnv import org.specs2.mutable.Specification -import org.specs2.specification.mutable.ExecutionEnvironment import uscala.concurrent.result.AsyncResult.{attemptFuture, attemptSync, fromFuture, fromResult, fail => asyncFail, ok => asyncOk} import uscala.result.Result import uscala.result.Result.{Fail, Ok} @@ -15,8 +14,7 @@ import uscala.result.specs2.ResultMatchers import scala.concurrent.Future import scala.concurrent.duration._ -class AsyncResultSpec extends Specification with ScalaCheck with ResultMatchers - with ExecutionEnvironment { def is(implicit ee: ExecutionEnv): Unit = { +class AsyncResultSpec(implicit ee: ExecutionEnv) extends Specification with ScalaCheck with ResultMatchers { def resultGen: Gen[Result[Int, Int]] = Gen.posNum[Int].flatMap(i => Gen.oneOf(Ok[Int](i), Fail[Int](i))) @@ -299,4 +297,4 @@ class AsyncResultSpec extends Specification with ScalaCheck with ResultMatchers } } } -}} \ No newline at end of file +} diff --git a/result-specs2/src/test/scala/uscala/result/specs2/ResultMatchersSpec.scala b/result-specs2/src/test/scala/uscala/result/specs2/ResultMatchersSpec.scala index 3cdbc60..4030a43 100644 --- a/result-specs2/src/test/scala/uscala/result/specs2/ResultMatchersSpec.scala +++ b/result-specs2/src/test/scala/uscala/result/specs2/ResultMatchersSpec.scala @@ -1,10 +1,9 @@ package uscala.result.specs2 import org.specs2.Spec -import org.specs2.matcher.{ResultMatchers => SResultMatchers} import uscala.result.Result._ -class ResultMatchersSpec extends Spec with SResultMatchers with ResultMatchers { def is = s2""" +class ResultMatchersSpec extends Spec with ResultMatchers { def is = s2""" The ResultMatchers trait provides matchers to check Result instances beOk checks if an element is Ok(_) @@ -14,7 +13,7 @@ class ResultMatchersSpec extends Spec with SResultMatchers with ResultMatchers { ${ Ok(1) must beOk(===(1)) } ${ Ok(Seq(1)) must beOk(===(Seq(1))) } ${ Ok(1) must beOk.like { case i => i must be_>(0) } } - ${ (Ok(1) must beOk.like { case i => i must be_<(0) }) returns "'Ok(1)' is Ok but 1 is not less than 0" } + ${ (Ok(1) must beOk.like { case i => i must be_<(0) }) returns "1 is not less than 0" } beFail checks if an element is Fail(_) ${ Fail(1) must beFail(1) } ${ Fail(1) must beFail(===(1)) } diff --git a/result/build.sbt b/result/build.sbt index 203eaaf..15580e9 100644 --- a/result/build.sbt +++ b/result/build.sbt @@ -13,6 +13,6 @@ scmInfo := Some(ScmInfo(browseUrl = new URL("https://github.com/albertpastrana/u connection = "scm:git:git@github.com:albertpastrana/uscala.git")) libraryDependencies ++= Seq( - "org.specs2" %% "specs2-core" % "3.8.6" % "test", - "org.specs2" %% "specs2-scalacheck" % "3.8.6" % "test" -) \ No newline at end of file + Dependencies.Specs2Core, + Dependencies.Specs2ScalaCheck +) diff --git a/retry/build.sbt b/retry/build.sbt index 49e399f..408356b 100644 --- a/retry/build.sbt +++ b/retry/build.sbt @@ -13,6 +13,6 @@ scmInfo := Some(ScmInfo(browseUrl = new URL("https://github.com/albertpastrana/u connection = "scm:git:git@github.com:albertpastrana/uscala.git")) libraryDependencies ++= Seq( - "org.specs2" %% "specs2-core" % "3.8.6" % "test", - "org.specs2" %% "specs2-scalacheck" % "3.8.6" % "test" + Dependencies.Specs2Core, + Dependencies.Specs2ScalaCheck ) diff --git a/timeout/build.sbt b/timeout/build.sbt index 13ad3f8..3fb9a0a 100644 --- a/timeout/build.sbt +++ b/timeout/build.sbt @@ -13,5 +13,5 @@ scmInfo := Some(ScmInfo(browseUrl = new URL("https://github.com/albertpastrana/u connection = "scm:git:git@github.com:albertpastrana/uscala.git")) libraryDependencies ++= Seq( - "org.specs2" %% "specs2-core" % "3.8.6" % "test" + Dependencies.Specs2Core ) diff --git a/url/build.sbt b/url/build.sbt index deaf51d..bea910a 100644 --- a/url/build.sbt +++ b/url/build.sbt @@ -13,6 +13,6 @@ scmInfo := Some(ScmInfo(browseUrl = new URL("https://github.com/albertpastrana/u connection = "scm:git:git@github.com:albertpastrana/uscala.git")) libraryDependencies ++= Seq( - "org.specs2" %% "specs2-core" % "3.8.6" % "test", - "org.specs2" %% "specs2-scalacheck" % "3.8.6" % "test" + Dependencies.Specs2Core, + Dependencies.Specs2ScalaCheck )