You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by as...@apache.org on 2009/02/27 09:52:15 UTC

svn commit: r748434 - /buildr/trunk/spec/scala/tests_spec.rb

Author: assaf
Date: Fri Feb 27 08:52:15 2009
New Revision: 748434

URL: http://svn.apache.org/viewvc?rev=748434&view=rev
Log:
BUILDR-93: Add specs for ScalaCheck integration

Modified:
    buildr/trunk/spec/scala/tests_spec.rb

Modified: buildr/trunk/spec/scala/tests_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/scala/tests_spec.rb?rev=748434&r1=748433&r2=748434&view=diff
==============================================================================
--- buildr/trunk/spec/scala/tests_spec.rb (original)
+++ buildr/trunk/spec/scala/tests_spec.rb Fri Feb 27 08:52:15 2009
@@ -305,6 +305,32 @@
     project('foo').test.passed_tests.should include('MySuite')
   end
 
+  it 'should run with ScalaCheck automatic test case generation' do
+    write 'src/test/scala/MySuite.scala', <<-SCALA
+      import org.scalatest.prop.PropSuite
+      import org.scalacheck.Arbitrary._
+      import org.scalacheck.Prop._
+      
+      class MySuite extends PropSuite {
+      
+        test("list concatenation") {
+          val x = List(1, 2, 3)
+          val y = List(4, 5, 6)
+          assert(x ::: y === List(1, 2, 3, 4, 5, 6))
+          check((a: List[Int], b: List[Int]) => a.size + b.size == (a ::: b).size)
+        }
+      
+        test(
+          "list concatenation using a test method",
+          (a: List[Int], b: List[Int]) => a.size + b.size == (a ::: b).size
+        )
+      }
+    SCALA
+    define('foo')
+    project('foo').test.invoke
+    project('foo').test.passed_tests.should include('MySuite')
+  end
+
   it 'should fail if ScalaCheck test case fails' do
     write 'src/test/scala/StringSuite.scala', <<-SCALA
       import org.scalatest.prop.PropSuite