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 2008/09/22 19:28:26 UTC
svn commit: r697910 - in /incubator/buildr/trunk/spec/java: ant.rb
tests_spec.rb
Author: assaf
Date: Mon Sep 22 10:28:25 2008
New Revision: 697910
URL: http://svn.apache.org/viewvc?rev=697910&view=rev
Log:
Added specs to verify Ant, JUnit and JMock versions are picked up from build.yaml file.
Added:
incubator/buildr/trunk/spec/java/ant.rb
Modified:
incubator/buildr/trunk/spec/java/tests_spec.rb
Added: incubator/buildr/trunk/spec/java/ant.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/java/ant.rb?rev=697910&view=auto
==============================================================================
--- incubator/buildr/trunk/spec/java/ant.rb (added)
+++ incubator/buildr/trunk/spec/java/ant.rb Mon Sep 22 10:28:25 2008
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with this
+# work for additional information regarding copyright ownership. The ASF
+# licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+
+require File.join(File.dirname(__FILE__), '../spec_helpers')
+
+
+describe Buildr::Ant do
+
+ it 'should pick Ant version from ant build settings' do
+ Buildr::Ant.instance_eval { @dependencies = nil }
+ write 'build.yaml', 'ant: 1.2.3'
+ Buildr::Ant.dependencies.should include("org.apache.ant:ant:jar:1.2.3")
+ end
+
+end
Modified: incubator/buildr/trunk/spec/java/tests_spec.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/java/tests_spec.rb?rev=697910&r1=697909&r2=697910&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/java/tests_spec.rb (original)
+++ incubator/buildr/trunk/spec/java/tests_spec.rb Mon Sep 22 10:28:25 2008
@@ -40,12 +40,27 @@
project('foo').test.dependencies.should include(artifact("junit:junit:jar:#{JUnit.version}"))
end
+ it 'should pick JUnit version from junit build settings' do
+ Buildr::JUnit.instance_eval { @dependencies = nil }
+ write 'build.yaml', 'junit: 1.2.3'
+ define('foo') { test.using(:junit) }
+ project('foo').test.compile.dependencies.should include(artifact("junit:junit:jar:1.2.3"))
+ end
+
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}"))
end
+ it 'should pick JUnit version from junit build settings' do
+ Buildr::JUnit.instance_eval { @dependencies = nil } # JUnit caches JMock dependencies
+ Buildr::JMock.instance_eval { @dependencies = nil }
+ write 'build.yaml', 'jmock: 1.2.3'
+ define('foo') { test.using(:junit) }
+ project('foo').test.compile.dependencies.should include(artifact("jmock:jmock:jar:1.2.3"))
+ end
+
it 'should include public classes extending junit.framework.TestCase' do
write 'src/test/java/com/example/FirstTest.java', <<-JAVA
package com.example;