What is the === (triple-equals) operator in Scala Koans?

This is the triple-equals operator from ScalaTest. Have a look at this page: Getting Started with FunSuite. It says: ScalaTest lets you use Scala’s assertion syntax, but defines a triple equals operator (===) to give you better error messages. The following code would give you an error indicating only that an assertion failed: assert(1 == … Read more

Scala: write string to file in one statement

It is strange that no one had suggested NIO.2 operations (available since Java 7): import java.nio.file.{Paths, Files} import java.nio.charset.StandardCharsets Files.write(Paths.get(“file.txt”), “file contents”.getBytes(StandardCharsets.UTF_8)) I think this is by far the simplest and easiest and most idiomatic way, and it does not need any dependencies sans Java itself.