Created
January 11, 2016 09:03
-
-
Save seratch/8a96ca87e0773cd5bab0 to your computer and use it in GitHub Desktop.
./gradlew test for Scala projects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| buildscript { | |
| repositories { | |
| maven { | |
| url "https://plugins.gradle.org/m2/" | |
| } | |
| } | |
| dependencies { | |
| classpath "com.github.maiflai:gradle-scalatest:0.11" | |
| } | |
| } | |
| apply plugin: 'scala' | |
| apply plugin: "com.github.maiflai.scalatest" | |
| ext { | |
| scalaMajorVersion = '2.11' | |
| scalaVersion = "${scalaMajorVersion}.7" | |
| } | |
| repositories { | |
| mavenCentral() | |
| } | |
| dependencies { | |
| compile "org.scala-lang:scala-library:${scalaVersion}" | |
| testCompile "junit:junit:4.12" | |
| testCompile "org.scalatest:scalatest_${scalaMajorVersion}:2.2.6" | |
| testRuntime "org.pegdown:pegdown:1.1.0" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package foo | |
| object Sample { | |
| def sayHelloTo(name: String): String = s"Hello, $name!" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package foo | |
| import org.scalatest._ | |
| //import org.junit.runner.RunWith | |
| //import org.scalatest.junit.JUnitRunner | |
| //@RunWith(classOf[JUnitRunner]) | |
| class SampleSpec extends WordSpec with Matchers { | |
| "Sample" should { | |
| "say hello to Martin" in { | |
| Sample.sayHelloTo("Martin") should equal("Hello, Martin!") | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment