Skip to content

Instantly share code, notes, and snippets.

@kevinmeredith
Last active April 3, 2017 19:14
Show Gist options
  • Save kevinmeredith/72245ab23f078295c3a4fa8c947203f4 to your computer and use it in GitHub Desktop.
Save kevinmeredith/72245ab23f078295c3a4fa8c947203f4 to your computer and use it in GitHub Desktop.
Unexpected issue with `ko(String)` on "org.specs2" %% "specs2" % "2.4.17"

Using ko("some message") succeeds when it should not on "2.4.17"

$cat build.sbt
scalaVersion := "2.11.8"

libraryDependencies += "org.specs2" %% "specs2" % "2.4.17"

$cat src/test/scala/x/Test.scala 
package x

import org.specs2._
import org.specs2.mutable.Specification
import org.specs2.matcher._
import org.specs2.matcher.StandardMatchResults.ko

object Test extends Specification {

	"this test should, but does not, fail" in new context {
		ko("this should fail but does not")
	}

	"this test should, and does, fail" in new context {
		ko
	}	

	trait context extends org.specs2.specification.Scope {}	
}

Result

$sbt test
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=2G; support was removed in 8.0
[info] Set current project to specs2_sandbox (in build file:/Users/kmeredith/Workspace/specs2_sandbox/)
[info] Updating {file:/Users/kmeredith/Workspace/specs2_sandbox/}specs2_sandbox...
[info] Resolving jline#jline;2.12.1 ...
[info] Done updating.
[info] Compiling 1 Scala source to /Users/kmeredith/Workspace/specs2_sandbox/target/scala-2.11/test-classes...
[info] Test
[info] + this test should, but does not, fail
[info] x this test should, and does, fail
[error]  ko (file:1)
[info] 
[info] 
[info] Total for specification Test
[info] Finished in 14 ms
[info] 2 examples, 1 failure, 0 error
[info]  
[error] Failed: Total 2, Failed 1, Errors 0, Passed 1
[error] Failed tests:
[error] 	x.Test
[error] (test:test) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 7 s, completed Apr 3, 2017 7:13:26 PM

Solution - use "org.specs2" %% "specs2" % "3.7"

  • Note - we (Rachel and I) changed the version of mobile-data-services/build.sbt in che locally
    • resulted in 10 compile-time errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment