vic-buildr 1.3.3 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +42 -11
- data/Rakefile +5 -3
- data/_buildr +9 -31
- data/addon/buildr/cobertura.rb +5 -218
- data/addon/buildr/drb.rb +281 -0
- data/addon/buildr/emma.rb +5 -220
- data/addon/buildr/nailgun.rb +94 -686
- data/bin/buildr +0 -9
- data/buildr.gemspec +6 -6
- data/doc/images/favicon.png +0 -0
- data/doc/pages/contributing.textile +6 -4
- data/doc/pages/download.textile +11 -0
- data/doc/pages/extending.textile +2 -2
- data/doc/pages/getting_started.textile +4 -4
- data/doc/pages/index.textile +8 -11
- data/doc/pages/more_stuff.textile +50 -22
- data/doc/pages/packaging.textile +1 -1
- data/doc/pages/projects.textile +2 -2
- data/doc/pages/settings_profiles.textile +2 -2
- data/doc/pages/testing.textile +1 -1
- data/doc/pages/whats_new.textile +12 -0
- data/doc/site.haml +1 -0
- data/lib/buildr.rb +2 -4
- data/lib/buildr/core.rb +2 -0
- data/lib/buildr/core/application.rb +304 -149
- data/lib/buildr/core/checks.rb +3 -131
- data/lib/buildr/core/common.rb +0 -4
- data/lib/buildr/core/compile.rb +1 -7
- data/lib/buildr/core/environment.rb +0 -3
- data/lib/buildr/core/filter.rb +7 -3
- data/lib/buildr/core/generate.rb +50 -52
- data/lib/buildr/core/help.rb +2 -1
- data/lib/buildr/core/osx.rb +49 -0
- data/lib/buildr/core/progressbar.rb +1 -1
- data/lib/buildr/core/project.rb +7 -9
- data/lib/buildr/core/test.rb +4 -4
- data/lib/buildr/core/transports.rb +13 -30
- data/lib/buildr/core/util.rb +8 -3
- data/lib/buildr/groovy/bdd.rb +1 -0
- data/lib/buildr/groovy/compiler.rb +1 -1
- data/lib/buildr/ide/eclipse.rb +30 -20
- data/lib/buildr/ide/idea.rb +3 -2
- data/lib/buildr/ide/idea7x.rb +4 -2
- data/lib/buildr/java/ant.rb +1 -1
- data/lib/buildr/java/bdd.rb +9 -5
- data/lib/buildr/java/cobertura.rb +236 -0
- data/lib/buildr/java/commands.rb +2 -1
- data/lib/buildr/java/emma.rb +238 -0
- data/lib/buildr/java/jtestr_runner.rb.erb +2 -0
- data/lib/buildr/java/packaging.rb +6 -2
- data/lib/buildr/java/pom.rb +0 -4
- data/lib/buildr/java/test_result.rb +45 -15
- data/lib/buildr/java/tests.rb +14 -9
- data/lib/buildr/packaging.rb +5 -2
- data/lib/buildr/packaging/archive.rb +488 -0
- data/lib/buildr/packaging/artifact.rb +36 -7
- data/lib/buildr/packaging/artifact_namespace.rb +2 -2
- data/lib/buildr/packaging/gems.rb +3 -3
- data/lib/buildr/packaging/package.rb +1 -1
- data/lib/buildr/packaging/tar.rb +85 -3
- data/lib/buildr/packaging/version_requirement.rb +172 -0
- data/lib/buildr/packaging/zip.rb +24 -682
- data/lib/buildr/packaging/ziptask.rb +313 -0
- data/lib/buildr/scala/compiler.rb +1 -1
- data/lib/buildr/scala/tests.rb +2 -2
- data/rakelib/apache.rake +58 -8
- data/rakelib/package.rake +4 -1
- data/rakelib/rspec.rake +2 -2
- data/rakelib/rubyforge.rake +6 -3
- data/rakelib/scm.rake +1 -1
- data/rakelib/setup.rake +0 -5
- data/rakelib/stage.rake +4 -1
- data/spec/addon/drb_spec.rb +328 -0
- data/spec/core/application_spec.rb +29 -22
- data/spec/core/build_spec.rb +8 -0
- data/spec/core/checks_spec.rb +293 -311
- data/spec/core/common_spec.rb +8 -2
- data/spec/core/compile_spec.rb +17 -1
- data/spec/core/generate_spec.rb +33 -0
- data/spec/core/project_spec.rb +18 -10
- data/spec/core/test_spec.rb +24 -1
- data/spec/ide/eclipse_spec.rb +96 -28
- data/spec/java/ant.rb +5 -0
- data/spec/java/bdd_spec.rb +4 -4
- data/spec/{addon → java}/cobertura_spec.rb +3 -3
- data/spec/{addon → java}/emma_spec.rb +3 -3
- data/spec/java/java_spec.rb +9 -1
- data/spec/java/packaging_spec.rb +19 -2
- data/spec/{addon → java}/test_coverage_spec.rb +7 -1
- data/spec/java/tests_spec.rb +5 -0
- data/spec/packaging/archive_spec.rb +1 -1
- data/spec/{core → packaging}/artifact_namespace_spec.rb +2 -2
- data/spec/packaging/artifact_spec.rb +46 -5
- data/spec/packaging/packaging_spec.rb +1 -1
- data/spec/sandbox.rb +16 -14
- data/spec/spec_helpers.rb +26 -3
- metadata +20 -11
- data/lib/buildr/core/application_cli.rb +0 -139
data/spec/core/common_spec.rb
CHANGED
@@ -242,7 +242,9 @@ end
|
|
242
242
|
describe Buildr::Filter do
|
243
243
|
before do
|
244
244
|
@filter = Filter.new
|
245
|
-
1.upto(4)
|
245
|
+
1.upto(4) do |i|
|
246
|
+
write "src/file#{i}", "file#{i} raw"
|
247
|
+
end
|
246
248
|
@early = Time.now - 1000
|
247
249
|
end
|
248
250
|
|
@@ -456,7 +458,9 @@ describe Buildr::Filter do
|
|
456
458
|
File.mtime('target').should be_close(@early, 10)
|
457
459
|
end
|
458
460
|
|
459
|
-
it 'should run only
|
461
|
+
it 'should run only on new files' do
|
462
|
+
# Make source files older so they're not copied twice.
|
463
|
+
Dir['src/**/*'].each { |file| File.utime(@early, @early, file) }
|
460
464
|
@filter.from('src').into('target').run
|
461
465
|
@filter.from('src').into('target').using { |file, content| file.should eql('file2') }.run
|
462
466
|
end
|
@@ -466,6 +470,8 @@ describe Buildr::Filter do
|
|
466
470
|
end
|
467
471
|
|
468
472
|
it 'should return false when run does not copy any files' do
|
473
|
+
# Make source files older so they're not copied twice.
|
474
|
+
Dir['src/**/*'].each { |file| File.utime(@early, @early, file) }
|
469
475
|
@filter.from('src').into('target').run
|
470
476
|
@filter.from('src').into('target').run.should be(false)
|
471
477
|
end
|
data/spec/core/compile_spec.rb
CHANGED
@@ -112,6 +112,15 @@ describe Buildr::CompileTask, '#compiler' do
|
|
112
112
|
compile.from('sources').compiler
|
113
113
|
end
|
114
114
|
end
|
115
|
+
|
116
|
+
it 'should allow supressing compilation' do
|
117
|
+
write 'src/main/java/package/Test.java', 'class Test {}'
|
118
|
+
define 'foo' do
|
119
|
+
compile.sources.clear
|
120
|
+
end
|
121
|
+
project('foo').compile.invoke
|
122
|
+
Dir['target/classes/*'].should be_empty
|
123
|
+
end
|
115
124
|
end
|
116
125
|
|
117
126
|
|
@@ -197,7 +206,8 @@ describe Buildr::CompileTask, '#dependencies' do
|
|
197
206
|
compile_task.dependencies.should == project('bar').packages
|
198
207
|
end
|
199
208
|
|
200
|
-
it 'should be accessible as classpath' do
|
209
|
+
it 'should be accessible as classpath up to version 1.5 since it was deprecated in version 1.3' do
|
210
|
+
Buildr::VERSION.should < '1.5'
|
201
211
|
lambda { compile_task.classpath = jars }.should change(compile_task, :dependencies).to(jars)
|
202
212
|
lambda { compile_task.dependencies = [] }.should change(compile_task, :classpath).to([])
|
203
213
|
end
|
@@ -545,6 +555,12 @@ describe Project, '#resources' do
|
|
545
555
|
file('target/resources').should_not exist
|
546
556
|
end
|
547
557
|
|
558
|
+
it 'should run from target/resources' do
|
559
|
+
write 'src/main/resources/test'
|
560
|
+
define('foo')
|
561
|
+
lambda { project('foo').resources.target.invoke }.should change { File.exist?('target/resources/test') }.to(true)
|
562
|
+
end
|
563
|
+
|
548
564
|
it 'should not be recursive' do
|
549
565
|
define('foo') { define 'bar' }
|
550
566
|
lambda { project('foo').resources.invoke }.should_not run_task('foo:bar:resources')
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
2
|
+
# contributor license agreements. See the NOTICE file distributed with this
|
3
|
+
# work for additional information regarding copyright ownership. The ASF
|
4
|
+
# licenses this file to you under the Apache License, Version 2.0 (the
|
5
|
+
# "License"); you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
12
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
13
|
+
# License for the specific language governing permissions and limitations under
|
14
|
+
# the License.
|
15
|
+
|
16
|
+
|
17
|
+
require File.join(File.dirname(__FILE__), '../spec_helpers')
|
18
|
+
|
19
|
+
|
20
|
+
describe Buildr::Generate do
|
21
|
+
|
22
|
+
describe 'Generated buildfile' do
|
23
|
+
it 'should be a legal buildfile' do
|
24
|
+
File.open('buildfile', 'w') { |file| file.write Generate.from_directory(Dir.pwd).join("\n") }
|
25
|
+
lambda { Buildr.application.run }.should_not raise_error
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'should not contain NEXT_VERSION because it was removed in buildr 1.3.3' do
|
29
|
+
buildfile = Generate.from_directory(Dir.pwd)
|
30
|
+
buildfile.each { |line| line.should_not include('NEXT_VERSION')}
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/spec/core/project_spec.rb
CHANGED
@@ -368,13 +368,17 @@ describe Project, '#on_define' do
|
|
368
368
|
define('foo') { define 'bar' }
|
369
369
|
scopes.should eql([['foo'], ['foo', 'bar']])
|
370
370
|
end
|
371
|
+
|
372
|
+
it 'should be removed in version 1.5 since it was deprecated in version 1.3' do
|
373
|
+
Buildr::VERSION.should < '1.5'
|
374
|
+
end
|
371
375
|
end
|
372
376
|
|
373
377
|
|
374
378
|
describe Rake::Task, ' recursive' do
|
375
379
|
before do
|
376
380
|
@order = []
|
377
|
-
Project.on_define do |project|
|
381
|
+
Project.on_define do |project| # TODO on_define is deprecated
|
378
382
|
project.recursive_task('doda') { @order << project.name }
|
379
383
|
end
|
380
384
|
define('foo') { define('bar') { define('baz') } }
|
@@ -428,6 +432,19 @@ describe 'Sub-project' do
|
|
428
432
|
project('foo').projects.map(&:name).should include('foo:bar')
|
429
433
|
end
|
430
434
|
|
435
|
+
it 'should be findable during project definition' do
|
436
|
+
define 'foo' do
|
437
|
+
bar = define 'bar' do
|
438
|
+
baz = define 'baz'
|
439
|
+
project('baz').should eql(baz)
|
440
|
+
end
|
441
|
+
# Note: evaluating bar:baz first unearthed a bug that doesn't happen
|
442
|
+
# if we evaluate bar, then bar:baz.
|
443
|
+
project('bar:baz').should be(bar.project('baz'))
|
444
|
+
project('bar').should be(bar)
|
445
|
+
end
|
446
|
+
end
|
447
|
+
|
431
448
|
it 'should be findable only if exists' do
|
432
449
|
define('foo') { define 'bar' }
|
433
450
|
lambda { project('foo').project('baz') }.should raise_error(RuntimeError, /No such project/)
|
@@ -743,12 +760,3 @@ describe Buildr::Generate do
|
|
743
760
|
end
|
744
761
|
end
|
745
762
|
=end
|
746
|
-
|
747
|
-
|
748
|
-
describe Rake::Task, 'buildr:initialize' do
|
749
|
-
it 'should evaluate all project definitions' do
|
750
|
-
defined = false
|
751
|
-
Buildr.define('foo') { defined = true }
|
752
|
-
lambda { task('buildr:initialize').invoke }.should change { defined }.to(true)
|
753
|
-
end
|
754
|
-
end
|
data/spec/core/test_spec.rb
CHANGED
@@ -115,7 +115,7 @@ describe Buildr::TestTask do
|
|
115
115
|
test_task.dependencies.should include(File.expand_path('test.jar'))
|
116
116
|
test_task.dependencies.should include(artifact('acme:example:jar:1.0'))
|
117
117
|
end
|
118
|
-
|
118
|
+
|
119
119
|
it 'should response to :options and return test framework options' do
|
120
120
|
test_task.using :foo=>'bar'
|
121
121
|
test_task.options[:foo].should eql('bar')
|
@@ -131,6 +131,13 @@ describe Buildr::TestTask do
|
|
131
131
|
test_task.options[:bar].should eql('BAR')
|
132
132
|
end
|
133
133
|
|
134
|
+
it 'should respond to :using with deprecated parameter style and set value options to true, up to version 1.5 since this usage was deprecated in version 1.3' do
|
135
|
+
Buildr::VERSION.should < '1.5'
|
136
|
+
test_task.using('foo', 'bar')
|
137
|
+
test_task.options[:foo].should eql(true)
|
138
|
+
test_task.options[:bar].should eql(true)
|
139
|
+
end
|
140
|
+
|
134
141
|
it 'should start without pre-selected test framework' do
|
135
142
|
test_task.framework.should be_nil
|
136
143
|
end
|
@@ -470,6 +477,22 @@ describe Buildr::Project, '#test' do
|
|
470
477
|
end
|
471
478
|
end
|
472
479
|
|
480
|
+
it 'should accept to set a test property in the top project' do
|
481
|
+
define 'foo' do
|
482
|
+
test.options[:properties][:foo] = 'bar'
|
483
|
+
end
|
484
|
+
project('foo').test.options[:properties][:foo].should == 'bar'
|
485
|
+
end
|
486
|
+
|
487
|
+
it 'should accept to set a test property in a subproject' do
|
488
|
+
define 'foo' do
|
489
|
+
define 'bar' do
|
490
|
+
test.options[:properties][:bar] = 'baz'
|
491
|
+
end
|
492
|
+
end
|
493
|
+
project('foo:bar').test.options[:properties][:bar].should == 'baz'
|
494
|
+
end
|
495
|
+
|
473
496
|
it 'should not change options of unrelated projects when using #options' do
|
474
497
|
define 'foo' do
|
475
498
|
test.options[:properties][:foo] = 'bar'
|
data/spec/ide/eclipse_spec.rb
CHANGED
@@ -41,6 +41,13 @@ module EclipseHelper
|
|
41
41
|
default_output[0]
|
42
42
|
end
|
43
43
|
|
44
|
+
# <classpathentry path="PATH" sourcepath="RETURNED_VALUE" kind="var"/>
|
45
|
+
def sourcepath_for_path path
|
46
|
+
classpath_xml_elements.collect("classpathentry[@kind='var',@path='#{path}']") do |n|
|
47
|
+
n.attributes['sourcepath'] || 'no source artifact'
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
44
51
|
def project_xml_elements
|
45
52
|
task('eclipse').invoke
|
46
53
|
REXML::Document.new(File.open('.project')).root.elements
|
@@ -52,22 +59,57 @@ describe Buildr::Eclipse do
|
|
52
59
|
include EclipseHelper
|
53
60
|
|
54
61
|
describe "eclipse's .project file" do
|
62
|
+
|
63
|
+
JAVA_CONTAINER = 'org.eclipse.jdt.launching.JRE_CONTAINER'
|
64
|
+
SCALA_CONTAINER = 'ch.epfl.lamp.sdt.launching.SCALA_CONTAINER'
|
65
|
+
|
66
|
+
SCALA_NATURE = 'ch.epfl.lamp.sdt.core.scalanature'
|
67
|
+
JAVA_NATURE = 'org.eclipse.jdt.core.javanature'
|
55
68
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
69
|
+
SCALA_BUILDER = 'ch.epfl.lamp.sdt.core.scalabuilder'
|
70
|
+
JAVA_BUILDER = 'org.eclipse.jdt.core.javabuilder'
|
71
|
+
|
72
|
+
def project_natures
|
73
|
+
project_xml_elements.collect("natures/nature") { |n| n.text }
|
74
|
+
end
|
75
|
+
|
76
|
+
def build_commands
|
77
|
+
project_xml_elements.collect("buildSpec/buildCommand/name") { |n| n.text }
|
78
|
+
end
|
79
|
+
|
80
|
+
describe 'java project' do
|
81
|
+
before do
|
82
|
+
write 'buildfile'
|
83
|
+
write 'src/main/java/Main.java'
|
84
|
+
end
|
60
85
|
|
61
|
-
|
62
|
-
|
86
|
+
it 'should have Java nature' do
|
87
|
+
define('foo')
|
88
|
+
project_natures.should include(JAVA_NATURE)
|
89
|
+
end
|
63
90
|
|
64
|
-
|
65
|
-
|
91
|
+
it 'should have Java build command' do
|
92
|
+
define('foo')
|
93
|
+
build_commands.should include(JAVA_BUILDER)
|
66
94
|
end
|
95
|
+
end
|
96
|
+
|
97
|
+
describe 'nested java project' do
|
67
98
|
|
68
|
-
|
69
|
-
|
99
|
+
it 'should have name corresponding to its project definition' do
|
100
|
+
mkdir 'foo'
|
101
|
+
define('myproject') {
|
102
|
+
project.version = '1.0'
|
103
|
+
define('foo') { compile.using(:javac); package :jar }
|
104
|
+
}
|
105
|
+
task('eclipse').invoke
|
106
|
+
REXML::Document.new(File.open(File.join('foo', '.project'))).root.
|
107
|
+
elements.collect("name") { |e| e.text }.should == ['myproject-foo']
|
70
108
|
end
|
109
|
+
|
110
|
+
end
|
111
|
+
|
112
|
+
describe 'scala project' do
|
71
113
|
|
72
114
|
before do
|
73
115
|
write 'buildfile'
|
@@ -92,10 +134,7 @@ describe Buildr::Eclipse do
|
|
92
134
|
describe "eclipse's .classpath file" do
|
93
135
|
|
94
136
|
describe 'scala project' do
|
95
|
-
|
96
|
-
SCALA_CONTAINER = 'ch.epfl.lamp.sdt.launching.SCALA_CONTAINER'
|
97
|
-
JAVA_CONTAINER = 'org.eclipse.jdt.launching.JRE_CONTAINER'
|
98
|
-
|
137
|
+
|
99
138
|
def classpath_containers attribute='path'
|
100
139
|
classpath_xml_elements.collect("classpathentry[@kind='con']") { |n| n.attributes[attribute] }
|
101
140
|
end
|
@@ -105,7 +144,7 @@ describe Buildr::Eclipse do
|
|
105
144
|
write 'src/main/scala/Main.scala'
|
106
145
|
end
|
107
146
|
|
108
|
-
it 'should have SCALA_CONTAINER before
|
147
|
+
it 'should have SCALA_CONTAINER before JAVA_CONTAINER' do
|
109
148
|
define('foo')
|
110
149
|
classpath_containers.should include(SCALA_CONTAINER)
|
111
150
|
classpath_containers.should include(JAVA_CONTAINER)
|
@@ -174,6 +213,12 @@ describe Buildr::Eclipse do
|
|
174
213
|
define('foo')
|
175
214
|
classpath_specific_output('src/test/java').should == 'target/test/classes'
|
176
215
|
end
|
216
|
+
|
217
|
+
it 'should accept to be the only code in the project' do
|
218
|
+
rm 'src/main/java/Main.java'
|
219
|
+
define('foo')
|
220
|
+
classpath_sources.should include('src/test/java')
|
221
|
+
end
|
177
222
|
end
|
178
223
|
|
179
224
|
describe 'main resources' do
|
@@ -223,21 +268,44 @@ describe Buildr::Eclipse do
|
|
223
268
|
classpath_specific_output('src/test/resources').should == 'target/test/resources'
|
224
269
|
end
|
225
270
|
end
|
271
|
+
end
|
226
272
|
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
end
|
273
|
+
describe 'project depending on another project' do
|
274
|
+
it 'should have the underlying project in its classpath' do
|
275
|
+
mkdir 'foo'
|
276
|
+
mkdir 'bar'
|
277
|
+
define('myproject') {
|
278
|
+
project.version = '1.0'
|
279
|
+
define('foo') { package :jar }
|
280
|
+
define('bar') { compile.using(:javac).with project('foo'); }
|
281
|
+
}
|
282
|
+
task('eclipse').invoke
|
283
|
+
REXML::Document.new(File.open(File.join('bar', '.classpath'))).root.
|
284
|
+
elements.collect("classpathentry[@kind='src']") { |n| n.attributes['path'] }.should include('/myproject-foo')
|
240
285
|
end
|
241
286
|
end
|
242
287
|
end
|
288
|
+
|
289
|
+
describe 'maven2 artifact dependency' do
|
290
|
+
before do
|
291
|
+
define('foo') { compile.using(:javac).with('com.example:library:jar:2.0') }
|
292
|
+
artifact('com.example:library:jar:2.0') { |task| write task.name }
|
293
|
+
task('eclipse').invoke
|
294
|
+
end
|
295
|
+
|
296
|
+
it 'should have a reference in the .classpath file relative to the local M2 repo' do
|
297
|
+
classpath_xml_elements.collect("classpathentry[@kind='var']") { |n| n.attributes['path'] }.
|
298
|
+
should include('M2_REPO/com/example/library/2.0/library-2.0.jar')
|
299
|
+
end
|
300
|
+
|
301
|
+
it 'should be downloaded' do
|
302
|
+
file(artifact('com.example:library:jar:2.0').name).should exist
|
303
|
+
end
|
304
|
+
|
305
|
+
it 'should have a source artifact reference in the .classpath file' do
|
306
|
+
sourcepath_for_path('M2_REPO/com/example/library/2.0/library-2.0.jar').
|
307
|
+
should == ['M2_REPO/com/example/library/2.0/library-2.0-sources.jar']
|
308
|
+
end
|
309
|
+
end
|
310
|
+
|
243
311
|
end
|
data/spec/java/ant.rb
CHANGED
@@ -24,5 +24,10 @@ describe Buildr::Ant do
|
|
24
24
|
write 'build.yaml', 'ant: 1.2.3'
|
25
25
|
Buildr::Ant.dependencies.should include("org.apache.ant:ant:jar:1.2.3")
|
26
26
|
end
|
27
|
+
|
28
|
+
it 'should have REQUIRES up to version 1.5 since it was deprecated in version 1.3.3' do
|
29
|
+
Buildr::VERSION.should < '1.5'
|
30
|
+
lambda { Ant::REQUIRES }.should_not raise_error
|
31
|
+
end
|
27
32
|
|
28
33
|
end
|
data/spec/java/bdd_spec.rb
CHANGED
@@ -38,7 +38,7 @@ describe Buildr::RSpec do
|
|
38
38
|
failure = File.expand_path('src/spec/ruby/failure_spec.rb')
|
39
39
|
write(failure, 'describe("failure") { it("is false") { true.should == false } }')
|
40
40
|
error = File.expand_path('src/spec/ruby/error_spec.rb')
|
41
|
-
write(error, 'describe("error") { it("raises") {
|
41
|
+
write(error, 'describe("error") { it("raises") { lambda; } }')
|
42
42
|
foo do
|
43
43
|
lambda { test.invoke }.should raise_error(/Tests failed/)
|
44
44
|
test.tests.should include(success, failure, error)
|
@@ -208,7 +208,7 @@ describe Buildr::JtestR do
|
|
208
208
|
require 'test/unit'
|
209
209
|
class TC_Error < Test::Unit::TestCase
|
210
210
|
def test_error
|
211
|
-
|
211
|
+
lambda;
|
212
212
|
end
|
213
213
|
end
|
214
214
|
TESTUNIT
|
@@ -226,7 +226,7 @@ describe Buildr::JtestR do
|
|
226
226
|
failure = File.expand_path('src/spec/ruby/failure_expect.rb')
|
227
227
|
write(failure, 'Expectations { expect(true) { false } }')
|
228
228
|
error = File.expand_path('src/spec/ruby/error_expect.rb')
|
229
|
-
write(error, 'Expectations { expect(nil) {
|
229
|
+
write(error, 'Expectations { expect(nil) { lambda; } }')
|
230
230
|
foo do
|
231
231
|
lambda { test.invoke }.should raise_error(/Tests failed/)
|
232
232
|
test.tests.should include(success, failure, error)
|
@@ -241,7 +241,7 @@ describe Buildr::JtestR do
|
|
241
241
|
failure = File.expand_path('src/spec/ruby/failure_spec.rb')
|
242
242
|
write(failure, 'describe("failure") { it("is false") { true.should == false } }')
|
243
243
|
error = File.expand_path('src/spec/ruby/error_spec.rb')
|
244
|
-
write(error, 'describe("error") { it("raises") {
|
244
|
+
write(error, 'describe("error") { it("raises") { lambda; } }')
|
245
245
|
pending = File.expand_path('src/spec/ruby/pending_spec.rb')
|
246
246
|
write(pending, 'describe("peding") { it "is not implemented" }')
|
247
247
|
foo do
|
@@ -15,15 +15,15 @@
|
|
15
15
|
|
16
16
|
|
17
17
|
require File.join(File.dirname(__FILE__), 'test_coverage_spec')
|
18
|
-
Sandbox.
|
18
|
+
Sandbox.require_optional_extension 'buildr/java/cobertura'
|
19
19
|
|
20
20
|
Buildr::Cobertura::requires
|
21
21
|
|
22
22
|
|
23
23
|
describe Buildr::Cobertura do
|
24
24
|
before do
|
25
|
-
# Reloading the
|
26
|
-
load File.expand_path('../
|
25
|
+
# Reloading the extension because the sandbox removes all its actions
|
26
|
+
load File.expand_path('../lib/buildr/java/cobertura.rb')
|
27
27
|
@tool_module = Buildr::Cobertura
|
28
28
|
end
|
29
29
|
|
@@ -15,7 +15,7 @@
|
|
15
15
|
|
16
16
|
|
17
17
|
require File.join(File.dirname(__FILE__), 'test_coverage_spec')
|
18
|
-
Sandbox.
|
18
|
+
Sandbox.require_optional_extension 'buildr/java/emma'
|
19
19
|
|
20
20
|
|
21
21
|
Buildr::Emma::requires
|
@@ -23,8 +23,8 @@ Buildr::Emma::requires
|
|
23
23
|
|
24
24
|
describe Buildr::Emma do
|
25
25
|
before do
|
26
|
-
# Reloading the
|
27
|
-
load File.expand_path('../
|
26
|
+
# Reloading the extension because the sandbox removes all its actions
|
27
|
+
load File.expand_path('../lib/buildr/java/emma.rb')
|
28
28
|
@tool_module = Buildr::Emma
|
29
29
|
end
|
30
30
|
|