Author: boisvert
Date: Wed Sep 14 13:23:48 2011
New Revision: 1170604

URL: http://svn.apache.org/viewvc?rev=1170604&view=rev
Log:
ScalaTest now automatically loads the Mockito library

Modified:
    buildr/trunk/CHANGELOG
    buildr/trunk/lib/buildr/scala/tests.rb
    buildr/trunk/spec/scala/tests_spec.rb

Modified: buildr/trunk/CHANGELOG
URL: 
http://svn.apache.org/viewvc/buildr/trunk/CHANGELOG?rev=1170604&r1=1170603&r2=1170604&view=diff
==============================================================================
--- buildr/trunk/CHANGELOG (original)
+++ buildr/trunk/CHANGELOG Wed Sep 14 13:23:48 2011
@@ -1,4 +1,5 @@
 1.4.7 (Pending)
+* Added:  ScalaTest now automatically loads the Mockito library
 * Fixed:  scaladoc generation with scala 2.9.x
 * Change: Stop pretty printing the Intellij IDEA project files to avoid IDEA 
breaking
           in the presence of non-normalized whitespace content.

Modified: buildr/trunk/lib/buildr/scala/tests.rb
URL: 
http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/scala/tests.rb?rev=1170604&r1=1170603&r2=1170604&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/scala/tests.rb (original)
+++ buildr/trunk/lib/buildr/scala/tests.rb Wed Sep 14 13:23:48 2011
@@ -14,6 +14,22 @@
 # the License.
 
 module Buildr::Scala
+
+  # Mockito is available when running ScalaTest
+  module Mockito
+    VERSION = '1.8.5'
+
+    class << self
+      def version
+        Buildr.settings.build['scalatest-mockito'] || 
Buildr.settings.build['mockito'] || VERSION
+      end
+
+      def dependencies
+        @dependencies ||= ["org.mockito:mockito-all:jar:#{version}"]
+      end
+    end
+  end
+
   # Scala::Check is available when using Scala::Test or Scala::Specs
   module Check
     VERSION = case
@@ -86,7 +102,7 @@ module Buildr::Scala
       end
 
       def dependencies
-        [specs] + Check.dependencies + JMock.dependencies + JUnit.dependencies
+        [specs] + Check.dependencies + JMock.dependencies + JUnit.dependencies 
+ Mockito.dependencies
       end
 
       def applies_to?(project) #:nodoc:

Modified: buildr/trunk/spec/scala/tests_spec.rb
URL: 
http://svn.apache.org/viewvc/buildr/trunk/spec/scala/tests_spec.rb?rev=1170604&r1=1170603&r2=1170604&view=diff
==============================================================================
--- buildr/trunk/spec/scala/tests_spec.rb (original)
+++ buildr/trunk/spec/scala/tests_spec.rb Wed Sep 14 13:23:48 2011
@@ -13,11 +13,10 @@
 # License for the specific language governing permissions and limitations under
 # the License.
 
+require File.expand_path(File.join(File.dirname(__FILE__), '..', 
'spec_helpers'))
 
 if Java.java.lang.System.getProperty("java.runtime.version") >= "1.6"
 
-require File.expand_path(File.join(File.dirname(__FILE__), '..', 
'spec_helpers'))
-
 # TODO's
 #  -test passing System props
 #  -test passing ENV variables


Reply via email to