Scalatest and type-safe equality

In Scalatest when using matchers you have many ways to test for equality, but only one of those is type-safe - should ===() So, if you have a function returning Int, like def f(i: Int): Int = i then the only type-safe way to test it is to use should ===() syntax, like f(5) should ===(5) »

Scalatest, Maven and Missing Tests

As you may know ScalaTest provides a JUnitRunner and you can perfectly run your scala tests as if they are regular junit tests. In particular, you can run them from maven, using surefire plugin. Why would you do this? In case you have a mixed Java/Scala project with tests written using junit as well »

Call Scala curried functions from Java

For some reason I thought scala curried functions is one of the features you will have troubles using from Java. But it happens that you can perfectly call a curried Scala function class A { def curried(i: Int)(s: String) = i + s.toInt } from Java new A().curried(5, "7") »

Sbt Plugins: No Default Package Please

Usually people don't put sbt builds in a package (I'm talking about scala files here), especially for simple and small projects. And they easily can use all the sbt plugins. But there are other users who have bigger and more complex builds. So they put their builds in packages and then they discover they can »

Override a list property for Typesafe Config

Today I naively was trying to override a list property for a unit test with the following code System.setProperty("", """[ "val1", "val2"]""") The tested code is reading the list property using typesafe config library val listProperty = config.getListString.asScala.toSet That was throwing com.typesafe.config.ConfigException$WrongType: system properties: has »

ReactiveMongo, macros and NoSuchElementException: None.get

ReactiveMongo employs scala macros to generate readers(deserializers) and writers(serializers) for scala case classes. They work pretty good, but sometimes you can get a java.lang.NoSuchElementException with message None.get :( Let's say you have case class Person(fisrtName: String, lastName: String, age: Int) object readers { implicit val personReader = Macros.reader[Person] } and somewhere »