buildr 1.3.2-java → 1.3.3-java
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 +66 -4
- data/{README → README.rdoc} +29 -16
- data/Rakefile +16 -20
- data/_buildr +38 -0
- data/addon/buildr/cobertura.rb +49 -45
- data/addon/buildr/emma.rb +238 -0
- data/addon/buildr/jetty.rb +1 -1
- data/addon/buildr/nailgun.rb +585 -661
- data/{lib/buildr/java → addon/buildr}/org/apache/buildr/BuildrNail$Main.class +0 -0
- data/{lib/buildr/java → addon/buildr}/org/apache/buildr/BuildrNail.class +0 -0
- data/{lib/buildr/java → addon/buildr}/org/apache/buildr/BuildrNail.java +0 -0
- data/bin/buildr +9 -2
- data/buildr.buildfile +53 -0
- data/buildr.gemspec +21 -14
- data/doc/css/default.css +51 -48
- data/doc/css/print.css +60 -55
- data/doc/images/favicon.png +0 -0
- data/doc/images/growl-icon.tiff +0 -0
- data/doc/images/project-structure.png +0 -0
- data/doc/pages/artifacts.textile +46 -156
- data/doc/pages/building.textile +63 -323
- data/doc/pages/contributing.textile +112 -102
- data/doc/pages/download.textile +19 -27
- data/doc/pages/extending.textile +27 -81
- data/doc/pages/getting_started.textile +44 -119
- data/doc/pages/index.textile +26 -47
- data/doc/pages/languages.textile +407 -0
- data/doc/pages/more_stuff.textile +92 -173
- data/doc/pages/packaging.textile +71 -239
- data/doc/pages/projects.textile +58 -233
- data/doc/pages/recipes.textile +19 -43
- data/doc/pages/settings_profiles.textile +39 -104
- data/doc/pages/testing.textile +41 -304
- data/doc/pages/troubleshooting.textile +29 -47
- data/doc/pages/whats_new.textile +69 -167
- data/doc/print.haml +0 -1
- data/doc/print.toc.yaml +1 -0
- data/doc/scripts/buildr-git.rb +1 -1
- data/doc/site.haml +1 -0
- data/doc/site.toc.yaml +8 -5
- data/{KEYS → etc/KEYS} +0 -0
- data/etc/git-svn-authors +16 -0
- data/lib/buildr.rb +2 -5
- data/lib/buildr/core/application.rb +192 -98
- data/lib/buildr/core/build.rb +140 -91
- data/lib/buildr/core/checks.rb +5 -5
- data/lib/buildr/core/common.rb +1 -1
- data/lib/buildr/core/compile.rb +12 -10
- data/lib/buildr/core/filter.rb +151 -46
- data/lib/buildr/core/generate.rb +9 -9
- data/lib/buildr/core/progressbar.rb +1 -1
- data/lib/buildr/core/project.rb +8 -7
- data/lib/buildr/core/test.rb +51 -26
- data/lib/buildr/core/transports.rb +22 -38
- data/lib/buildr/core/util.rb +78 -26
- data/lib/buildr/groovy.rb +18 -0
- data/lib/buildr/groovy/bdd.rb +105 -0
- data/lib/buildr/groovy/compiler.rb +138 -0
- data/lib/buildr/ide/eclipse.rb +102 -71
- data/lib/buildr/ide/idea.rb +7 -12
- data/lib/buildr/ide/idea7x.rb +7 -8
- data/lib/buildr/java.rb +4 -7
- data/lib/buildr/java/ant.rb +26 -5
- data/lib/buildr/java/bdd.rb +449 -0
- data/lib/buildr/java/commands.rb +9 -9
- data/lib/buildr/java/{compilers.rb → compiler.rb} +8 -90
- data/lib/buildr/java/jruby.rb +29 -11
- data/lib/buildr/java/jtestr_runner.rb.erb +116 -0
- data/lib/buildr/java/packaging.rb +23 -16
- data/lib/buildr/java/pom.rb +1 -1
- data/lib/buildr/java/rjb.rb +21 -8
- data/lib/buildr/java/test_result.rb +308 -0
- data/lib/buildr/java/tests.rb +324 -0
- data/lib/buildr/packaging/artifact.rb +12 -11
- data/lib/buildr/packaging/artifact_namespace.rb +7 -4
- data/lib/buildr/packaging/gems.rb +3 -3
- data/lib/buildr/packaging/zip.rb +13 -10
- data/lib/buildr/resources/buildr.icns +0 -0
- data/lib/buildr/scala.rb +19 -0
- data/lib/buildr/scala/compiler.rb +109 -0
- data/lib/buildr/scala/tests.rb +203 -0
- data/rakelib/apache.rake +71 -45
- data/rakelib/doc.rake +2 -2
- data/rakelib/package.rake +3 -2
- data/rakelib/rspec.rake +23 -21
- data/rakelib/setup.rake +34 -9
- data/rakelib/stage.rake +4 -1
- data/spec/addon/cobertura_spec.rb +77 -0
- data/spec/addon/emma_spec.rb +120 -0
- data/spec/addon/test_coverage_spec.rb +255 -0
- data/spec/{application_spec.rb → core/application_spec.rb} +82 -4
- data/spec/{artifact_namespace_spec.rb → core/artifact_namespace_spec.rb} +12 -1
- data/spec/core/build_spec.rb +415 -0
- data/spec/{checks_spec.rb → core/checks_spec.rb} +2 -2
- data/spec/{common_spec.rb → core/common_spec.rb} +119 -30
- data/spec/{compile_spec.rb → core/compile_spec.rb} +17 -13
- data/spec/core/generate_spec.rb +33 -0
- data/spec/{project_spec.rb → core/project_spec.rb} +9 -6
- data/spec/{test_spec.rb → core/test_spec.rb} +222 -28
- data/spec/{transport_spec.rb → core/transport_spec.rb} +5 -9
- data/spec/groovy/bdd_spec.rb +80 -0
- data/spec/{groovy_compilers_spec.rb → groovy/compiler_spec.rb} +1 -1
- data/spec/ide/eclipse_spec.rb +243 -0
- data/spec/{java_spec.rb → java/ant.rb} +7 -17
- data/spec/java/bdd_spec.rb +358 -0
- data/spec/{java_compilers_spec.rb → java/compiler_spec.rb} +1 -1
- data/spec/java/java_spec.rb +88 -0
- data/spec/{java_packaging_spec.rb → java/packaging_spec.rb} +65 -4
- data/spec/{java_test_frameworks_spec.rb → java/tests_spec.rb} +31 -10
- data/spec/{archive_spec.rb → packaging/archive_spec.rb} +12 -2
- data/spec/{artifact_spec.rb → packaging/artifact_spec.rb} +12 -5
- data/spec/{packaging_helper.rb → packaging/packaging_helper.rb} +0 -0
- data/spec/{packaging_spec.rb → packaging/packaging_spec.rb} +1 -1
- data/spec/sandbox.rb +22 -5
- data/spec/{scala_compilers_spec.rb → scala/compiler_spec.rb} +1 -1
- data/spec/{scala_test_frameworks_spec.rb → scala/tests_spec.rb} +11 -12
- data/spec/spec_helpers.rb +38 -17
- metadata +93 -70
- data/lib/buildr/java/bdd_frameworks.rb +0 -265
- data/lib/buildr/java/groovyc.rb +0 -137
- data/lib/buildr/java/test_frameworks.rb +0 -450
- data/spec/build_spec.rb +0 -193
- data/spec/java_bdd_frameworks_spec.rb +0 -238
- data/spec/spec.opts +0 -6
data/spec/build_spec.rb
DELETED
|
@@ -1,193 +0,0 @@
|
|
|
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 'local task', :shared=>true do
|
|
21
|
-
it "should execute task for project in current directory" do
|
|
22
|
-
define 'foobar'
|
|
23
|
-
lambda { @task.invoke }.should run_task("foobar:#{@task.name}")
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
it "should not execute task for projects in other directory" do
|
|
27
|
-
define 'foobar', :base_dir=>'elsewhere'
|
|
28
|
-
lambda { task('build').invoke }.should_not run_task('foobar:build')
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
describe 'build task' do
|
|
34
|
-
it_should_behave_like 'local task'
|
|
35
|
-
before(:each) { @task = task('build') }
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
describe 'clean task' do
|
|
39
|
-
it_should_behave_like 'local task'
|
|
40
|
-
before(:each) { @task = task('clean') }
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
describe 'package task' do
|
|
44
|
-
it_should_behave_like 'local task'
|
|
45
|
-
before(:each) { @task = task('package') }
|
|
46
|
-
|
|
47
|
-
it 'should execute build task as prerequisite' do
|
|
48
|
-
lambda { @task.invoke }.should run_task('build')
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
describe 'install task' do
|
|
53
|
-
it_should_behave_like 'local task'
|
|
54
|
-
before(:each) { @task = task('install') }
|
|
55
|
-
|
|
56
|
-
it 'should execute package task as prerequisite' do
|
|
57
|
-
lambda { @task.invoke }.should run_task('package')
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
describe 'uninstall task' do
|
|
62
|
-
it_should_behave_like 'local task'
|
|
63
|
-
before(:each) { @task = task('uninstall') }
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
describe 'upload task' do
|
|
67
|
-
it_should_behave_like 'local task'
|
|
68
|
-
before(:each) { @task = task('upload') }
|
|
69
|
-
|
|
70
|
-
it 'should execute package task as prerequisite' do
|
|
71
|
-
lambda { @task.invoke }.should run_task('package')
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
describe Project, '#build' do
|
|
77
|
-
it 'should return the project\'s build task' do
|
|
78
|
-
define('foo').build.should eql(task('foo:build'))
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
it 'should enhance the project\'s build task' do
|
|
82
|
-
task 'prereq'
|
|
83
|
-
task 'action'
|
|
84
|
-
define 'foo' do
|
|
85
|
-
build 'prereq' do
|
|
86
|
-
task('action').invoke
|
|
87
|
-
end
|
|
88
|
-
end
|
|
89
|
-
lambda { project('foo').build.invoke }.should run_tasks('prereq', 'action')
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
it 'should execute build task for sub-project' do
|
|
93
|
-
define 'foo' do
|
|
94
|
-
define 'bar'
|
|
95
|
-
end
|
|
96
|
-
lambda { task('foo:build').invoke }.should run_task('foo:bar:build')
|
|
97
|
-
end
|
|
98
|
-
|
|
99
|
-
it 'should not execute build task of other projects' do
|
|
100
|
-
define 'foo'
|
|
101
|
-
define 'bar'
|
|
102
|
-
lambda { task('foo:build').invoke }.should_not run_task('bar:build')
|
|
103
|
-
end
|
|
104
|
-
end
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
describe Project, '#clean' do
|
|
108
|
-
it 'should return the project\'s clean task' do
|
|
109
|
-
define('foo').clean.should eql(task('foo:clean'))
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
it 'should enhance the project\'s clean task' do
|
|
113
|
-
task 'prereq'
|
|
114
|
-
task 'action'
|
|
115
|
-
define 'foo' do
|
|
116
|
-
clean 'prereq' do
|
|
117
|
-
task('action').invoke
|
|
118
|
-
end
|
|
119
|
-
end
|
|
120
|
-
lambda { project('foo').clean.invoke }.should run_tasks('prereq', 'action')
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
it 'should remove target directory' do
|
|
124
|
-
define 'foo' do
|
|
125
|
-
self.layout[:target] = 'targeted'
|
|
126
|
-
end
|
|
127
|
-
mkpath 'targeted'
|
|
128
|
-
lambda { project('foo').clean.invoke }.should change { File.exist?('targeted') }.from(true).to(false)
|
|
129
|
-
end
|
|
130
|
-
|
|
131
|
-
it 'should remove reports directory' do
|
|
132
|
-
define 'foo' do
|
|
133
|
-
self.layout[:reports] = 'reported'
|
|
134
|
-
end
|
|
135
|
-
mkpath 'reported'
|
|
136
|
-
lambda { project('foo').clean.invoke }.should change { File.exist?('reported') }.from(true).to(false)
|
|
137
|
-
end
|
|
138
|
-
|
|
139
|
-
it 'should execute clean task for sub-project' do
|
|
140
|
-
define 'foo' do
|
|
141
|
-
define 'bar'
|
|
142
|
-
end
|
|
143
|
-
lambda { task('foo:clean').invoke }.should run_task('foo:bar:clean')
|
|
144
|
-
end
|
|
145
|
-
|
|
146
|
-
it 'should not execute clean task of other projects' do
|
|
147
|
-
define 'foo'
|
|
148
|
-
define 'bar'
|
|
149
|
-
lambda { task('foo:clean').invoke }.should_not run_task('bar:clean')
|
|
150
|
-
end
|
|
151
|
-
end
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
describe Project, '#target' do
|
|
155
|
-
before :each do
|
|
156
|
-
@project = define('foo', :layout=>Layout.new)
|
|
157
|
-
end
|
|
158
|
-
|
|
159
|
-
it 'should default to target' do
|
|
160
|
-
@project.target.should eql('target')
|
|
161
|
-
end
|
|
162
|
-
|
|
163
|
-
it 'should set layout :target' do
|
|
164
|
-
@project.target = 'bar'
|
|
165
|
-
@project.layout.expand(:target).should point_to_path('bar')
|
|
166
|
-
end
|
|
167
|
-
|
|
168
|
-
it 'should come from layout :target' do
|
|
169
|
-
@project.layout[:target] = 'baz'
|
|
170
|
-
@project.target.should eql('baz')
|
|
171
|
-
end
|
|
172
|
-
end
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
describe Project, '#reports' do
|
|
176
|
-
before :each do
|
|
177
|
-
@project = define('foo', :layout=>Layout.new)
|
|
178
|
-
end
|
|
179
|
-
|
|
180
|
-
it 'should default to reports' do
|
|
181
|
-
@project.reports.should eql('reports')
|
|
182
|
-
end
|
|
183
|
-
|
|
184
|
-
it 'should set layout :reports' do
|
|
185
|
-
@project.reports = 'bar'
|
|
186
|
-
@project.layout.expand(:reports).should point_to_path('bar')
|
|
187
|
-
end
|
|
188
|
-
|
|
189
|
-
it 'should come from layout :reports' do
|
|
190
|
-
@project.layout[:reports] = 'baz'
|
|
191
|
-
@project.reports.should eql('baz')
|
|
192
|
-
end
|
|
193
|
-
end
|
|
@@ -1,238 +0,0 @@
|
|
|
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
|
-
require File.join(File.dirname(__FILE__), 'spec_helpers')
|
|
17
|
-
|
|
18
|
-
describe Buildr::RSpec do
|
|
19
|
-
|
|
20
|
-
def foo(*args, &prc)
|
|
21
|
-
define('foo', *args) do
|
|
22
|
-
test.using :rspec
|
|
23
|
-
if prc
|
|
24
|
-
instance_eval(&prc)
|
|
25
|
-
else
|
|
26
|
-
self
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
it 'should be selected by :rspec name' do
|
|
32
|
-
foo { test.framework.should eql(:rspec) }
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
it 'should include src/spec/ruby/**/*_spec.rb' do
|
|
36
|
-
verbose true
|
|
37
|
-
foo do
|
|
38
|
-
spec = _(:source, :spec, :ruby, 'some_spec.rb')
|
|
39
|
-
write spec, ''
|
|
40
|
-
test.invoke
|
|
41
|
-
test.tests.should include(spec)
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
end if PLATFORM =~ /java/ # RSpec
|
|
47
|
-
|
|
48
|
-
describe Buildr::JtestR do
|
|
49
|
-
|
|
50
|
-
def foo(*args, &prc)
|
|
51
|
-
define('foo', *args) do
|
|
52
|
-
test.using :jtestr
|
|
53
|
-
if prc
|
|
54
|
-
instance_eval(&prc)
|
|
55
|
-
else
|
|
56
|
-
self
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
it 'should be selected by :jtestr name' do
|
|
62
|
-
foo { test.framework.should eql(:jtestr) }
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
it 'should include src/spec/ruby/**/*_spec.rb'
|
|
66
|
-
it 'should auto generate jtestr configuration'
|
|
67
|
-
it 'should run runit test cases'
|
|
68
|
-
it 'should use a java compiler if java sources found'
|
|
69
|
-
it 'should run junit test cases'
|
|
70
|
-
|
|
71
|
-
end # JtestR
|
|
72
|
-
|
|
73
|
-
describe Buildr::JBehave do
|
|
74
|
-
def foo(*args, &prc)
|
|
75
|
-
define('foo', *args) do
|
|
76
|
-
test.using :jbehave
|
|
77
|
-
if prc
|
|
78
|
-
instance_eval(&prc)
|
|
79
|
-
else
|
|
80
|
-
self
|
|
81
|
-
end
|
|
82
|
-
end
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
it 'should apply to projects having JBehave sources' do
|
|
86
|
-
define('one', :base_dir => 'one') do
|
|
87
|
-
write _(:source, :spec, :java, 'SomeBehaviour.java'), 'public class SomeBehaviour {}'
|
|
88
|
-
JBehave.applies_to?(self).should be_true
|
|
89
|
-
end
|
|
90
|
-
define('two', :base_dir => 'two') do
|
|
91
|
-
write _(:source, :test, :java, 'SomeBehaviour.java'), 'public class SomeBehaviour {}'
|
|
92
|
-
JBehave.applies_to?(self).should be_false
|
|
93
|
-
end
|
|
94
|
-
define('three', :base_dir => 'three') do
|
|
95
|
-
write _(:source, :spec, :java, 'SomeBehavior.java'), 'public class SomeBehavior {}'
|
|
96
|
-
JBehave.applies_to?(self).should be_true
|
|
97
|
-
end
|
|
98
|
-
define('four', :base_dir => 'four') do
|
|
99
|
-
write _(:source, :test, :java, 'SomeBehavior.java'), 'public class SomeBehavior {}'
|
|
100
|
-
JBehave.applies_to?(self).should be_false
|
|
101
|
-
end
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
it 'should be selected by :jbehave name' do
|
|
105
|
-
foo { test.framework.should eql(:jbehave) }
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
it 'should select a java compiler for its sources' do
|
|
109
|
-
foo do
|
|
110
|
-
write _(:source, :spec, :java, 'SomeBehavior.java'), 'public class SomeBehavior {}'
|
|
111
|
-
test.compile.language.should eql(:java)
|
|
112
|
-
end
|
|
113
|
-
end
|
|
114
|
-
|
|
115
|
-
it 'should include JBehave dependencies' do
|
|
116
|
-
foo do
|
|
117
|
-
test.compile.dependencies.should include(*artifacts(JBehave::REQUIRES))
|
|
118
|
-
test.dependencies.should include(*artifacts(JBehave::REQUIRES))
|
|
119
|
-
end
|
|
120
|
-
end
|
|
121
|
-
|
|
122
|
-
it 'should include JMock dependencies' do
|
|
123
|
-
foo do
|
|
124
|
-
test.compile.dependencies.should include(*artifacts(JMock::REQUIRES))
|
|
125
|
-
test.dependencies.should include(*artifacts(JMock::REQUIRES))
|
|
126
|
-
end
|
|
127
|
-
end
|
|
128
|
-
|
|
129
|
-
it 'should include classes whose name ends with Behavior' do
|
|
130
|
-
write 'src/spec/java/some/FooBehavior.java', <<-JAVA
|
|
131
|
-
package some;
|
|
132
|
-
public class FooBehavior {
|
|
133
|
-
public void shouldFoo() { assert true; }
|
|
134
|
-
}
|
|
135
|
-
JAVA
|
|
136
|
-
write 'src/spec/java/some/NotATest.java', <<-JAVA
|
|
137
|
-
package some;
|
|
138
|
-
public class NotATest { }
|
|
139
|
-
JAVA
|
|
140
|
-
foo.tap do |project|
|
|
141
|
-
project.test.invoke
|
|
142
|
-
project.test.tests.should include('some.FooBehavior')
|
|
143
|
-
end
|
|
144
|
-
end
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
it 'should include classes implementing Behaviours' do
|
|
148
|
-
write 'src/spec/java/some/MyBehaviours.java', <<-JAVA
|
|
149
|
-
package some;
|
|
150
|
-
public class MyBehaviours implements
|
|
151
|
-
org.jbehave.core.behaviour.Behaviours {
|
|
152
|
-
public Class[] getBehaviours() {
|
|
153
|
-
return new Class[] { some.FooBehave.class };
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
JAVA
|
|
157
|
-
write 'src/spec/java/some/FooBehave.java', <<-JAVA
|
|
158
|
-
package some;
|
|
159
|
-
public class FooBehave {
|
|
160
|
-
public void shouldFoo() { assert true; }
|
|
161
|
-
}
|
|
162
|
-
JAVA
|
|
163
|
-
write 'src/spec/java/some/NotATest.java', <<-JAVA
|
|
164
|
-
package some;
|
|
165
|
-
public class NotATest { }
|
|
166
|
-
JAVA
|
|
167
|
-
foo.tap do |project|
|
|
168
|
-
project.test.invoke
|
|
169
|
-
project.test.tests.should include('some.MyBehaviours')
|
|
170
|
-
end
|
|
171
|
-
end
|
|
172
|
-
|
|
173
|
-
end # JBehave
|
|
174
|
-
|
|
175
|
-
describe Buildr::EasyB do
|
|
176
|
-
|
|
177
|
-
def foo(*args, &prc)
|
|
178
|
-
define('foo', *args) do
|
|
179
|
-
test.using :easyb
|
|
180
|
-
if prc
|
|
181
|
-
instance_eval(&prc)
|
|
182
|
-
else
|
|
183
|
-
self
|
|
184
|
-
end
|
|
185
|
-
end
|
|
186
|
-
end
|
|
187
|
-
|
|
188
|
-
it 'should apply to a project having EasyB sources' do
|
|
189
|
-
define('one', :base_dir => 'one') do
|
|
190
|
-
write _(:source, :spec, :groovy, 'SomeBehaviour.groovy'), 'true;'
|
|
191
|
-
EasyB.applies_to?(self).should be_true
|
|
192
|
-
end
|
|
193
|
-
define('two', :base_dir => 'two') do
|
|
194
|
-
write _(:source, :test, :groovy, 'SomeBehaviour.groovy'), 'true;'
|
|
195
|
-
EasyB.applies_to?(self).should be_false
|
|
196
|
-
end
|
|
197
|
-
define('three', :base_dir => 'three') do
|
|
198
|
-
write _(:source, :spec, :groovy, 'SomeStory.groovy'), 'true;'
|
|
199
|
-
EasyB.applies_to?(self).should be_true
|
|
200
|
-
end
|
|
201
|
-
define('four', :base_dir => 'four') do
|
|
202
|
-
write _(:source, :test, :groovy, 'SomeStory.groovy'), 'true;'
|
|
203
|
-
EasyB.applies_to?(self).should be_false
|
|
204
|
-
end
|
|
205
|
-
end
|
|
206
|
-
|
|
207
|
-
it 'should be selected by :easyb name' do
|
|
208
|
-
foo { test.framework.should eql(:easyb) }
|
|
209
|
-
end
|
|
210
|
-
|
|
211
|
-
it 'should select a java compiler if java sources are found' do
|
|
212
|
-
foo do
|
|
213
|
-
write _(:source, :spec, :java, 'SomeBehavior.java'), 'public class SomeBehavior {}'
|
|
214
|
-
test.compile.language.should eql(:java)
|
|
215
|
-
end
|
|
216
|
-
end
|
|
217
|
-
|
|
218
|
-
it 'should include src/spec/groovy/*Behavior.groovy' do
|
|
219
|
-
foo do
|
|
220
|
-
spec = _(:source, :spec, :groovy, 'SomeBehavior.groovy')
|
|
221
|
-
write spec, 'true'
|
|
222
|
-
test.invoke
|
|
223
|
-
test.tests.should include(spec)
|
|
224
|
-
end
|
|
225
|
-
end
|
|
226
|
-
|
|
227
|
-
it 'should include src/spec/groovy/*Story.groovy' do
|
|
228
|
-
foo do
|
|
229
|
-
spec = _(:source, :spec, :groovy, 'SomeStory.groovy')
|
|
230
|
-
write spec, 'true'
|
|
231
|
-
test.invoke
|
|
232
|
-
test.tests.should include(spec)
|
|
233
|
-
end
|
|
234
|
-
end
|
|
235
|
-
|
|
236
|
-
end # EasyB
|
|
237
|
-
|
|
238
|
-
|