Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
88 views

I have a small specification that uses json matcher import org.specs2.matcher.JsonMatchers import org.specs2.mutable.Specification class Test extends Specification with JsonMatchers { "test&...
nigredo's user avatar
  • 63
0 votes
0 answers
44 views

I'm trying to get HTML output for the specs2 tests I start with sbt. However, the template html file which does exist in my Scala project at the expected location is not found. The error message ...
hellerim's user avatar
  • 187
0 votes
1 answer
129 views

Let's say I have a class which has 10 auto injected items: @Singleton class ExampleClass @Inject() ( implicit configuration: Configuration, secondModule: SecondModule, thirdModule: ThirdModule,...
Shivam Sahil's user avatar
  • 5,227
0 votes
0 answers
237 views

I am using following configuration to run a test case using specs2 specification and specs2 mockito and mocked a method that is supposed to return int but it gives following error. java.lang....
Shashi's user avatar
  • 41
0 votes
0 answers
133 views

I have a Scala project based on play framework. I am using specs2 mockito and specifications for test cases. When running the test cases, I am getting following error: Exception in thread "specs2-...
Shashi's user avatar
  • 41
0 votes
1 answer
107 views

If I have a specs2 test like the following: import org.specs2.mutable.Specification import scala.util.Try class Tests extends Specification { def foo(): Unit = throw new Exception("oops")...
Thayne's user avatar
  • 7,099
0 votes
1 answer
130 views

We have an issue with different environments for our integration tests and start/stop latency. So, we want to run all environment dependencies before all integration tests and shut down after all. We ...
skilgal's user avatar
  • 184
1 vote
1 answer
722 views

I am writing a test with specs2 and mockito in Scala. The test should verify that a function foo running asynchronously calls barMock.bar() In order to verify the barMock.bar() call I can use verify : ...
Michael's user avatar
  • 42.3k
0 votes
0 answers
80 views

Specs2 has these Either matchers: private[specs2] trait EitherBaseMatchers { def beRight[T](t: ValueCheck[T]) = RightCheckedMatcher(t) def beRight[T](implicit p: ImplicitParam = implicitParameter)...
satyagraha's user avatar
0 votes
0 answers
145 views

I am trying to run Specs2 with Quarkus. My test classes are annotated with @QuarkusTest. When I try to run the tests with maven, it does not find any tests. I tried adding the @RunWith(classOf[...
user2102276's user avatar
1 vote
2 answers
306 views

Using Specs2, if I do: 1 must beEqualTo(2) 1 must beEqualTo(1) The test fails (as expected) If I do: Result.foreach(1 to 10) { i => i must_== 2 } Result.foreach(1 to 10) {...
danio's user avatar
  • 8,721
3 votes
2 answers
858 views

class OptionLikeMatcher[F[_], T, U](typeName: String, toOption: F[T] => Option[U]) extends Matcher[F[T]] { ... } case class RightMatcher[T]() extends OptionLikeMatcher[({type l[a]=Either[_, a]})#l, ...
Curious Wolf's user avatar
1 vote
1 answer
137 views

In specs2, given the following code: import org.specs2.mutable.SpecificationWithJUnit trait TestSuite extends SpecificationWithJUnit { ... } class ConcreteTest extends TestSuite { // want to skip ...
Genry's user avatar
  • 1,408
1 vote
1 answer
294 views

I have Scala Play project which uses specs2 as the test framework. I'm having difficult time running the tests from IntelliJ. I get the following error: InvocationTargetException for 'main' in org....
stuckoverflow's user avatar
2 votes
0 answers
2k views

I have a poly repository kind project in Intellij IDEA built with Pants. Individual modules are built with sbt. So I want to debug Specs2 tests using Intellij IDEA debugger. I moved the module I need ...
Cassie's user avatar
  • 3,139
1 vote
1 answer
67 views

How can I call a self-written spec2 Notifier from the Java command line without using sbt. I want to do this: java -cp "testJars/*" org.specs2.runner.files "**/*" <here add ...
Tawfeek's user avatar
  • 13
0 votes
1 answer
187 views

I am currently working on maven based scala project with a bunch of specs2 specification tests and am using Intellij 2020.2 and scala 2.12.10 with specs2 version 4.9.4 I am able to run each ...
colinbes's user avatar
  • 467
0 votes
1 answer
276 views

Using Play 2.7. In a test class, I want to test a service that reads the configuration (properties) file conf/fun.conf. I could not find any example how to carry out this feat. I have looked at the ...
rapt's user avatar
  • 12.4k
0 votes
1 answer
187 views

I try to upgrade a Scala/Play project to Play 2.7, Scala 2.12.11, Specs2 4.5.1. In the project there is the following Specs2 test that I cannot understand in the sense of its Specs2 specification ...
rapt's user avatar
  • 12.4k
0 votes
1 answer
2k views

I am trying to upgrade a Scala/Play application to Play 2.7, Scala 2.12.11. I have the following test that probably used to work before I upgraded Play and Scala. After the upgrade, I got the ...
rapt's user avatar
  • 12.4k
1 vote
1 answer
2k views

I am supposedly contributing to the integration tests of a library which relies on specs with the underlying implementation written in Scala. The testing is more bind towards the stream of events ...
Naman's user avatar
  • 32.9k
2 votes
1 answer
813 views

I'm new in cats and functional programming and I'm struggling with unit testing functional data types like EitherT. Having example code: class Library[F[_]]() { def create(book: Book)(implicit M:...
michallos's user avatar
7 votes
1 answer
413 views

I have an interesting problem where I basically need to create a .jar (plus all of the classpath dependencies) that contains all of the tests of an SBT project (plus any of its subprojects). The idea ...
mdedetrich's user avatar
  • 1,889
5 votes
2 answers
173 views

I am building the integration tests which would read the data generated after the previous test cases and check it with expected result. When I run the tests the generated data is not visible in the ...
Cassie's user avatar
  • 3,139
0 votes
1 answer
70 views

I upgraded specs2 version from 2.4.12 -> 3.8.9 and when I run a test an error has been occured : [error] the pandoc executable is not available at: pandoc [error] Error: Total 6, Failed 4, Errors 1, ...
Im89's user avatar
  • 149
1 vote
2 answers
199 views

Is it possible to compare only part of string in property of case class. Using scala specs2 lib. Is there is a possibility to write such matcher? CaseClass(property = Prop("very long string")) must ...
Edgaras Buchvalovas's user avatar
0 votes
1 answer
531 views

I upgraded play framework to version 2.4, but in my jars file I still see specs2 version 2.4.13 jars that I did not understand their origin, since play framework 2.4 uses specs2 independently this ...
med10's user avatar
  • 111
0 votes
0 answers
67 views

I have recently upgraded play version to 2.4 coming from 2.3, Since I'am using specs2 for writing tests, I needed to add the following line to the sbt file: libraryDependency += specs2 % Test ...
med10's user avatar
  • 111
0 votes
1 answer
89 views

I've got the following spec: import org.specs2.mutable.{After, Specification} import org.specs2.specification.Scope import org.specs2.specification.core.{Fragment, Fragments} class TestRefSpec ...
Alexandr Antonov's user avatar
3 votes
1 answer
140 views

I was wondering why ScalaTest behaves differently compared to Specs2. Specs2 "" must be equalTo 3 TestSpec.scala:11:26: type mismatch; [error] found : Int(3) [error] required: String [error] ...
Somatik's user avatar
  • 4,743
2 votes
2 answers
458 views

I am writing some Specs2 specifications; that looks like: class ComponentSpecification extends Specification with Mockito { private val dependency = mock[Dependency] private val subject = new ...
gervais.b's user avatar
  • 2,367
0 votes
1 answer
361 views

I'm writing Specs2 tests that use a temporary file and properties from ScalaCheck. Without properties it works fine : import better.files.File import org.specs2.execute.{AsResult, Result} import org....
KaC's user avatar
  • 613
2 votes
2 answers
1k views

I upgraded a Play 2.6 project to Play 2.7. The project compiles, but I get a NoSuchMethodError in a test: Exception in thread "specs2-8" java.lang.NoSuchMethodError: org.mockito.internal.progress....
Mirco's user avatar
  • 3,016
0 votes
1 answer
375 views

I'm using ScalikeJDBC with Play. I want to apply evolutions to an in-memory database for my Specs2 tests. import org.specs2.mutable.Specification import org.specs2.specification.BeforeAfterAll import ...
Synesso's user avatar
  • 39.4k
0 votes
1 answer
120 views

The Gherkin-like syntax is very useful to put examples at the bottom of the specification and unfortunately it seems from the documentation that Specs2 doesn't support it. (Although it supports Tables,...
Edmondo's user avatar
  • 20.1k
1 vote
2 answers
993 views

Scala noob here. I currently try to create functional tests for a Play (Scala) based web application using specs2. The examples themselves are simple, i.e.: class SignInSpec extends ...
user1576088's user avatar
2 votes
1 answer
246 views

Scala noob here. I don't understand the following piece of code, taken from a Play application's integration test (Scala): package workflows.admin import play.api.test._ class SignInSpec extends ...
user1576088's user avatar
2 votes
2 answers
243 views

Let's say I have two instances of the typeclass Numeric. class Money(c: String, x: Long, y: Int) class Quantity(c: String, x: Long, y: Int) implicit val numericMoney: Numeric[Money] = new Numeric[...
mrt181's user avatar
  • 5,346
0 votes
0 answers
991 views

I am trying to write a unit test for a specific method which calls a REST endpoint with given inputs(url, http method, body, headers). Below is the code. def genericAPICall(uri: String, method: ...
Venkat's user avatar
  • 81
2 votes
1 answer
383 views

I am trying to mock my interactions with an external API that checks a token to see if the user is authorized to perform certain actions (it is currently a seperate API as a PoC that is going to be ...
vamsiampolu's user avatar
  • 6,744
0 votes
1 answer
138 views

I'm in a situtation where I have 2 traits extending BeforeAfterAll doing different actions for integration tests: One managing the database and the other the file system. For example: trait ...
Luciano's user avatar
  • 43
0 votes
2 answers
2k views

@Singleton class EventPublisher @Inject() (@Named("rabbit-mq-event-update-actor") rabbitControlActor: ActorRef) (implicit ctx: ExecutionContext) { def publish(event: Event): Unit = { logger....
Arun Gupta's user avatar
3 votes
1 answer
1k views

I want to compare 2 sequences of doubles in a specs2 test, something along the lines of: actualValues must containTheSameElementsAs(expectedValues, _ beCloseTo _) I can write a manual comparison like ...
danio's user avatar
  • 8,721
0 votes
1 answer
34 views

I need a way to unit test a play scala project using Specs2's Given/When/Then style but the acceptances is written in the text file in like how it is in Jbehave.
Carlos Galo Campos's user avatar
1 vote
1 answer
244 views

I'm writing a new Scala Play 2.6 web service, and trying to write a unit test for a controller that accepts XML payloads. When I call the controller from the unit test, however, I get a 400 returned ...
Jared's user avatar
  • 2,163
0 votes
1 answer
847 views

Upon upgrading to specs2 version 4, our tests which were using Future matchers started to fail. This is what those tests look like: class SomeSpec(implicit ee: ExecutionEnv) extends Specification { ...
Mehdi's user avatar
  • 7
3 votes
1 answer
2k views

While writing tests I'm confronted with the following exception: java.lang.ClassCastException: codegen.java.lang.Object$MockitoMock$641592186 cannot be cast to cats.effect.IO (MyRepositorySpec.scala:...
Raphael Mäder's user avatar
0 votes
1 answer
516 views

I cannot import PlaySpecification. First, it seems to be part of Specs2, but after importing specs2 it doesnt'show up. https://playframework.com/documentation/2.6.x/ScalaFunctionalTestingWithSpecs2#...
rodbs's user avatar
  • 195
0 votes
1 answer
389 views

I'm getting this error (overloaded method ) for method route, status, contentAsJson. Any ideas why? import play.api.test._ import play.api.test.Helpers import play.api.libs.json.Json class ItemsSpec ...
rodbs's user avatar
  • 195
1 vote
0 answers
53 views

I've read https://www.playframework.com/documentation/2.4.x/SBTSubProjects to create a project composed of multiple Play applications. There are three Play sub-projects in modules directory. I need to ...
Mattia Micomonaco's user avatar

1
2 3 4 5
11