Permalink
Browse files

add other scala TestCase samples (via Specs and by "extends TestCase"…

… (old way))
  • Loading branch information...
1 parent bb0a31b commit 3defd7bb265b6a527f194e8cde738dc302fca746 @davidB davidB committed with davidB Jun 11, 2010
@@ -17,14 +17,12 @@
<version>4.8.1</version>
<scope>test</scope>
</dependency>
- <!--
<dependency>
<groupId>org.scala-tools.testing</groupId>
<artifactId>specs_2.8.0.Beta1</artifactId>
<version>1.6.4</version>
<scope>test</scope>
</dependency>
- -->
</dependencies>
<build>
@@ -0,0 +1,15 @@
+package samples
+
+import org.junit.Assert._
+import junit.framework.TestCase
+
+class Calculator2Test extends TestCase {
+
+ def test_ok() = assertTrue(true)
+
+ def test_basicSum() = {
+ val subject = new Calculator()
+ assertEquals(10, subject.sum(5, 5))
+ assertEquals(10, subject.sum(1, 9))
+ }
+}
@@ -0,0 +1,12 @@
+package samples
+
+import org.specs._
+
+class SpecsTest extends SpecificationWithJUnit {
+ "'hello world' has 11 characters" in {
+ "hello world".size must_== 11
+ }
+ "'hello world' matches 'h.* w.*'" in {
+ "hello world" must be matching("h.* w.*")
+ }
+}

0 comments on commit 3defd7b

Please sign in to comment.