Author: boisvert
Date: Sun Feb 28 15:40:52 2010
New Revision: 917191
URL: http://svn.apache.org/viewvc?rev=917191&view=rev
Log:
BUILDR-150: Upgrade to JMock 2.5.1 (Antoine Toulme)
Modified:
buildr/trunk/CHANGELOG
buildr/trunk/lib/buildr/java/tests.rb
buildr/trunk/spec/java/bdd_spec.rb
buildr/trunk/spec/java/tests_spec.rb
Modified: buildr/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/buildr/trunk/CHANGELOG?rev=917191&r1=917190&r2=917191&view=diff
==============================================================================
--- buildr/trunk/CHANGELOG (original)
+++ buildr/trunk/CHANGELOG Sun Feb 28 15:40:52 2010
@@ -25,6 +25,7 @@
* Change: Updated to JRuby 1.4.0
* Change: Updated to JtestR 0.5
* Change: Updated to JUnit 4.7
+* Change: Updated to JMock 2.5.1 (Antoine Toulme)
* Change: Load buildr.rb from $HOME/.buildr instead of $HOME
($HOME/buildr.rb is still loaded with deprecation warning)
* Fixed: BUILDR-223 Release Task: customizable commit message (Alexis Midon)
Modified: buildr/trunk/lib/buildr/java/tests.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/java/tests.rb?rev=917191&r1=917190&r2=917191&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/java/tests.rb (original)
+++ buildr/trunk/lib/buildr/java/tests.rb Sun Feb 28 15:40:52 2010
@@ -94,7 +94,7 @@
# JMock is available when using JUnit and TestNG, JBehave.
module JMock
- VERSION = '1.2.0'
+ VERSION = '2.5.1'
class << self
def version
@@ -102,7 +102,16 @@
end
def dependencies
- @dependencies ||= ["jmock:jmock:jar:#{version}"]
+ two_or_later = version[0,1].to_i >= 2
+ group = two_or_later ? "org.jmock" : "jmock"
+
+ @dependencies ||= ["#{group}:jmock:jar:#{version}"]
+ if two_or_later
+ @dependencies << "org.jmock:jmock-junit#{Buildr::JUnit.version[0,1]}:jar:#{version}"
+ @dependencies << "org.hamcrest:hamcrest-core:jar:1.1"
+ @dependencies << "org.hamcrest:hamcrest-library:jar:1.1"
+ end
+ @dependencies
end
private
Modified: buildr/trunk/spec/java/bdd_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/java/bdd_spec.rb?rev=917191&r1=917190&r2=917191&view=diff
==============================================================================
--- buildr/trunk/spec/java/bdd_spec.rb (original)
+++ buildr/trunk/spec/java/bdd_spec.rb Sun Feb 28 15:40:52 2010
@@ -327,8 +327,10 @@
it 'should include JMock dependencies' do
foo do
- test.compile.dependencies.should include(artifact("jmock:jmock:jar:#{JMock.version}"))
- test.dependencies.should include(artifact("jmock:jmock:jar:#{JMock.version}"))
+ two_or_later = JMock.version[0,1].to_i >= 2
+ group = two_or_later ? "org.jmock" : "jmock"
+ test.compile.dependencies.should include(artifact("#{group}:jmock:jar:#{JMock.version}"))
+ test.dependencies.should include(artifact("#{group}:jmock:jar:#{JMock.version}"))
end
end
Modified: buildr/trunk/spec/java/tests_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/java/tests_spec.rb?rev=917191&r1=917190&r2=917191&view=diff
==============================================================================
--- buildr/trunk/spec/java/tests_spec.rb (original)
+++ buildr/trunk/spec/java/tests_spec.rb Sun Feb 28 15:40:52 2010
@@ -54,8 +54,10 @@
it 'should include JMock dependencies' do
define('foo') { test.using(:junit) }
- project('foo').test.compile.dependencies.should include(artifact("jmock:jmock:jar:#{JMock.version}"))
- project('foo').test.dependencies.should include(artifact("jmock:jmock:jar:#{JMock.version}"))
+ two_or_later = JMock.version[0,1].to_i >= 2
+ group = two_or_later ? "org.jmock" : "jmock"
+ project('foo').test.compile.dependencies.should include(artifact("#{group}:jmock:jar:#{JMock.version}"))
+ project('foo').test.dependencies.should include(artifact("#{group}:jmock:jar:#{JMock.version}"))
end
it 'should pick JUnit version from junit build settings' do
@@ -374,8 +376,10 @@
it 'should include TestNG dependencies' do
define('foo') { test.using :testng }
- project('foo').test.compile.dependencies.should include(artifact("jmock:jmock:jar:#{JMock.version}"))
- project('foo').test.dependencies.should include(artifact("jmock:jmock:jar:#{JMock.version}"))
+ two_or_later = JMock.version[0,1].to_i >= 2
+ group = two_or_later ? "org.jmock" : "jmock"
+ project('foo').test.compile.dependencies.should include(artifact("#{group}:jmock:jar:#{JMock.version}"))
+ project('foo').test.dependencies.should include(artifact("#{group}:jmock:jar:#{JMock.version}"))
end
it 'should include classes using TestNG annotations' do
|