albacore 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +4 -4
- data/.bundle/config +2 -2
- data/.rvmrc +1 -1
- data/Gemfile +12 -12
- data/README.markdown +92 -68
- data/VERSION +1 -1
- data/lib/albacore.rb +9 -9
- data/lib/albacore/albacoretask.rb +50 -50
- data/lib/albacore/aspnetcompiler.rb +58 -58
- data/lib/albacore/assemblyinfo.rb +140 -140
- data/lib/albacore/assemblyinfolanguages/cppcliengine.rb +17 -0
- data/lib/albacore/assemblyinfolanguages/csharpengine.rb +18 -18
- data/lib/albacore/assemblyinfolanguages/vbnetengine.rb +18 -18
- data/lib/albacore/config/aspnetcompilerconfig.rb +29 -29
- data/lib/albacore/config/assemblyinfoconfig.rb +13 -13
- data/lib/albacore/config/config.rb +22 -22
- data/lib/albacore/config/cscconfig.rb +28 -28
- data/lib/albacore/config/docuconfig.rb +23 -23
- data/lib/albacore/config/execconfig.rb +15 -15
- data/lib/albacore/config/fluentmigratorrunnerconfig.rb +15 -15
- data/lib/albacore/config/msbuildconfig.rb +29 -29
- data/lib/albacore/config/mspectestrunnerconfig.rb +15 -15
- data/lib/albacore/config/mstesttestrunnerconfig.rb +15 -15
- data/lib/albacore/config/nantconfig.rb +15 -15
- data/lib/albacore/config/nchurnconfig.rb +15 -15
- data/lib/albacore/config/ncoverconsoleconfig.rb +15 -15
- data/lib/albacore/config/ncoverreportconfig.rb +15 -15
- data/lib/albacore/config/ndependconfig.rb +15 -15
- data/lib/albacore/config/netversion.rb +21 -21
- data/lib/albacore/config/nugetpackconfig.rb +3 -3
- data/lib/albacore/config/nugetpublishconfig.rb +19 -0
- data/lib/albacore/config/nugetpushconfig.rb +19 -0
- data/lib/albacore/config/nunittestrunnerconfig.rb +14 -14
- data/lib/albacore/config/specflowreportconfig.rb +24 -24
- data/lib/albacore/config/sqlcmdconfig.rb +15 -15
- data/lib/albacore/config/unzipconfig.rb +15 -15
- data/lib/albacore/config/vssgetconfig.rb +14 -0
- data/lib/albacore/config/xbuildconfig.rb +15 -15
- data/lib/albacore/config/xunittestrunnerconfig.rb +15 -15
- data/lib/albacore/config/zipdirectoryconfig.rb +15 -15
- data/lib/albacore/csc.rb +66 -62
- data/lib/albacore/docu.rb +41 -41
- data/lib/albacore/exec.rb +18 -18
- data/lib/albacore/fluentmigratorrunner.rb +51 -46
- data/lib/albacore/msbuild.rb +55 -55
- data/lib/albacore/mspectestrunner.rb +50 -50
- data/lib/albacore/mstesttestrunner.rb +43 -43
- data/lib/albacore/nant.rb +38 -38
- data/lib/albacore/nchurn.rb +74 -74
- data/lib/albacore/ncoverconsole.rb +68 -68
- data/lib/albacore/ncoverreport.rb +62 -62
- data/lib/albacore/ncoverreports/assemblyfilter.rb +9 -9
- data/lib/albacore/ncoverreports/branchcoverage.rb +9 -9
- data/lib/albacore/ncoverreports/classfilter.rb +9 -9
- data/lib/albacore/ncoverreports/codecoveragebase.rb +25 -25
- data/lib/albacore/ncoverreports/cyclomaticcomplexity.rb +23 -23
- data/lib/albacore/ncoverreports/documentfilter.rb +9 -9
- data/lib/albacore/ncoverreports/fullcoveragereport.rb +13 -13
- data/lib/albacore/ncoverreports/methodcoverage.rb +9 -9
- data/lib/albacore/ncoverreports/methodfilter.rb +9 -9
- data/lib/albacore/ncoverreports/namespacefilter.rb +9 -9
- data/lib/albacore/ncoverreports/reportfilterbase.rb +26 -26
- data/lib/albacore/ncoverreports/summaryreport.rb +18 -18
- data/lib/albacore/ncoverreports/symbolcoverage.rb +9 -9
- data/lib/albacore/ndepend.rb +33 -33
- data/lib/albacore/nugetpublish.rb +47 -0
- data/lib/albacore/nugetpush.rb +46 -0
- data/lib/albacore/nunittestrunner.rb +41 -41
- data/lib/albacore/nuspec.rb +133 -109
- data/lib/albacore/output.rb +99 -99
- data/lib/albacore/plink.rb +47 -47
- data/lib/albacore/specflowreport.rb +62 -62
- data/lib/albacore/sqlcmd.rb +80 -80
- data/lib/albacore/support/attrmethods.rb +33 -33
- data/lib/albacore/support/createtask.rb +50 -30
- data/lib/albacore/support/failure.rb +15 -15
- data/lib/albacore/support/logging.rb +38 -38
- data/lib/albacore/support/openstruct.rb +13 -13
- data/lib/albacore/support/runcommand.rb +45 -45
- data/lib/albacore/support/supportlinux.rb +23 -23
- data/lib/albacore/support/updateattributes.rb +13 -13
- data/lib/albacore/support/yamlconfig.rb +18 -18
- data/lib/albacore/unzip.rb +28 -28
- data/lib/albacore/vssget.rb +44 -0
- data/lib/albacore/xbuild.rb +54 -54
- data/lib/albacore/xunittestrunner.rb +52 -52
- data/lib/albacore/zipdirectory.rb +105 -105
- data/rakefile.rb +297 -297
- data/spec/albacoremodel_spec.rb +53 -53
- data/spec/assemblyinfo_spec.rb +541 -541
- data/spec/attrmethods_spec.rb +136 -136
- data/spec/config_spec.rb +34 -34
- data/spec/createtask_spec.rb +236 -236
- data/spec/csc_spec.rb +253 -253
- data/spec/docu_spec.rb +109 -109
- data/spec/exec_spec.rb +45 -45
- data/spec/fluentmigratorrunner_spec.rb +254 -185
- data/spec/msbuild_spec.rb +215 -215
- data/spec/mspec_spec.rb +28 -28
- data/spec/mstesttestrunner_spec.rb +142 -142
- data/spec/nant_spec.rb +110 -110
- data/spec/nchurn_spec.rb +75 -75
- data/spec/ncoverconsole_spec.rb +353 -353
- data/spec/ncoverreport_spec.rb +619 -619
- data/spec/ndepend_spec.rb +72 -72
- data/spec/nunittestrunner_spec.rb +122 -122
- data/spec/nuspec_spec.rb +78 -78
- data/spec/patches/docu_patch.rb +12 -12
- data/spec/patches/fail_patch.rb +8 -8
- data/spec/patches/system_patch.rb +20 -20
- data/spec/plink_spec.rb +62 -62
- data/spec/runcommand_spec.rb +94 -94
- data/spec/spec_helper.rb +17 -17
- data/spec/specflowreport_spec.rb +146 -146
- data/spec/sqlcmd_spec.rb +334 -334
- data/spec/support/assemblyinfotester.rb +51 -51
- data/spec/support/ironruby_validator.rb +26 -26
- data/spec/support/msbuildtestdata.rb +32 -32
- data/spec/support/nanttestdata.rb +33 -33
- data/spec/support/ncoverconsoletestdata.rb +19 -19
- data/spec/support/ncoverreporttestdata.rb +26 -26
- data/spec/support/nokogiri_validator.rb +15 -15
- data/spec/support/outputtestdata.rb +12 -12
- data/spec/support/ziptestdata.rb +12 -12
- data/spec/unzip_spec.rb +15 -15
- data/spec/xbuild_spec.rb +15 -15
- data/spec/xunit_spec.rb +168 -168
- data/spec/yamlconfig_spec.rb +49 -49
- data/spec/zip_spec.rb +104 -104
- data/watchrtesting.rb +8 -8
- metadata +15 -119
@@ -1,142 +1,142 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'albacore/mstesttestrunner'
|
3
|
-
|
4
|
-
shared_examples_for "mstest paths" do
|
5
|
-
before :all do
|
6
|
-
@mstestpath = File.join(File.dirname(__FILE__), 'support', 'Tools', 'MSTest-2008', 'mstest.exe')
|
7
|
-
@test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'CodeCoverage', 'mstest', 'TestSolution.MSTestTests.dll')
|
8
|
-
@test_option = "/test:Test"
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
describe MSTestTestRunner, "the command parameters for an mstest runner" do
|
13
|
-
it_should_behave_like "mstest paths"
|
14
|
-
|
15
|
-
before :all do
|
16
|
-
mstest = MSTestTestRunner.new(@mstestpath)
|
17
|
-
mstest.assemblies @test_assembly
|
18
|
-
mstest.options @test_option
|
19
|
-
mstest.tests 'APassingTest', 'AFailingTest'
|
20
|
-
|
21
|
-
@command_parameters = mstest.get_command_parameters
|
22
|
-
end
|
23
|
-
|
24
|
-
it "should not include the path to the command" do
|
25
|
-
@command_parameters.should_not include(@mstestpath)
|
26
|
-
end
|
27
|
-
|
28
|
-
it "should include the list of assemblies" do
|
29
|
-
@command_parameters.should include("/testcontainer:\"#{@test_assembly}\"")
|
30
|
-
end
|
31
|
-
|
32
|
-
it "should include the specific set of tests" do
|
33
|
-
@command_parameters.should include("/test:APassingTest /test:AFailingTest")
|
34
|
-
end
|
35
|
-
|
36
|
-
it "should include the list of options" do
|
37
|
-
@command_parameters.should include(@test_option)
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
describe MSTestTestRunner, "the command line string for an mstest runner" do
|
42
|
-
it_should_behave_like "mstest paths"
|
43
|
-
|
44
|
-
before :all do
|
45
|
-
mstest = MSTestTestRunner.new(@mstestpath)
|
46
|
-
mstest.assemblies @test_assembly
|
47
|
-
|
48
|
-
@command_line = mstest.get_command_line
|
49
|
-
@command_parameters = mstest.get_command_parameters.join(" ")
|
50
|
-
end
|
51
|
-
|
52
|
-
it "should start with the path to the command" do
|
53
|
-
@command_line.split(" ").first.should == @mstestpath
|
54
|
-
end
|
55
|
-
|
56
|
-
it "should include the command parameters" do
|
57
|
-
@command_line.should include(@command_parameters)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
|
62
|
-
describe MSTestTestRunner, "when configured correctly" do
|
63
|
-
it_should_behave_like "mstest paths"
|
64
|
-
|
65
|
-
before :all do
|
66
|
-
mstest = MSTestTestRunner.new(@mstestpath)
|
67
|
-
mstest.extend(FailPatch)
|
68
|
-
mstest.assemblies @test_assembly
|
69
|
-
mstest.log_level = :verbose
|
70
|
-
mstest.tests "APassingTest"
|
71
|
-
mstest.execute
|
72
|
-
end
|
73
|
-
|
74
|
-
it "should execute" do
|
75
|
-
$task_failed.should be_false
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
describe MSTestTestRunner, "when configured correctly, but a test fails" do
|
80
|
-
it_should_behave_like "mstest paths"
|
81
|
-
|
82
|
-
before :all do
|
83
|
-
mstest = MSTestTestRunner.new(@mstestpath)
|
84
|
-
mstest.extend(FailPatch)
|
85
|
-
mstest.assemblies @test_assembly
|
86
|
-
mstest.log_level = :verbose
|
87
|
-
mstest.tests "AFailingTest"
|
88
|
-
mstest.execute
|
89
|
-
end
|
90
|
-
|
91
|
-
it "should fail" do
|
92
|
-
$task_failed.should be_true
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
describe MSTestTestRunner, "when using the configuration command and not providing a command in the intializer" do
|
97
|
-
it_should_behave_like "mstest paths"
|
98
|
-
|
99
|
-
before :all do
|
100
|
-
Albacore.configure do |config|
|
101
|
-
config.mstest.command = "configured command"
|
102
|
-
end
|
103
|
-
@mstest = MSTestTestRunner.new
|
104
|
-
end
|
105
|
-
|
106
|
-
it "should use the configuration command" do
|
107
|
-
@mstest.command.should == "configured command"
|
108
|
-
end
|
109
|
-
end
|
110
|
-
|
111
|
-
describe MSTestTestRunner, "when the command has been set through configuration and providing a command in the intializer" do
|
112
|
-
it_should_behave_like "mstest paths"
|
113
|
-
|
114
|
-
before :all do
|
115
|
-
Albacore.configure do |config|
|
116
|
-
config.mstest.command = "configured command"
|
117
|
-
end
|
118
|
-
@mstest = MSTestTestRunner.new("initializer command")
|
119
|
-
end
|
120
|
-
|
121
|
-
it "should use the initializer command" do
|
122
|
-
@mstest.command.should == "initializer command"
|
123
|
-
end
|
124
|
-
end
|
125
|
-
|
126
|
-
describe MSTestTestRunner, "when configuration has been provided" do
|
127
|
-
before :all do
|
128
|
-
Albacore.configure do |config|
|
129
|
-
config.mstest do |mstest|
|
130
|
-
mstest.assemblies = ["foo.dll", "bar.dll"]
|
131
|
-
mstest.options = ["/test"]
|
132
|
-
end
|
133
|
-
end
|
134
|
-
|
135
|
-
@mstest = MSTestTestRunner.new
|
136
|
-
end
|
137
|
-
|
138
|
-
it "should use the provided configuration" do
|
139
|
-
@mstest.assemblies.should == ["foo.dll", "bar.dll"]
|
140
|
-
@mstest.options.should == ["/test"]
|
141
|
-
end
|
142
|
-
end
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'albacore/mstesttestrunner'
|
3
|
+
|
4
|
+
shared_examples_for "mstest paths" do
|
5
|
+
before :all do
|
6
|
+
@mstestpath = File.join(File.dirname(__FILE__), 'support', 'Tools', 'MSTest-2008', 'mstest.exe')
|
7
|
+
@test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'CodeCoverage', 'mstest', 'TestSolution.MSTestTests.dll')
|
8
|
+
@test_option = "/test:Test"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
describe MSTestTestRunner, "the command parameters for an mstest runner" do
|
13
|
+
it_should_behave_like "mstest paths"
|
14
|
+
|
15
|
+
before :all do
|
16
|
+
mstest = MSTestTestRunner.new(@mstestpath)
|
17
|
+
mstest.assemblies @test_assembly
|
18
|
+
mstest.options @test_option
|
19
|
+
mstest.tests 'APassingTest', 'AFailingTest'
|
20
|
+
|
21
|
+
@command_parameters = mstest.get_command_parameters
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should not include the path to the command" do
|
25
|
+
@command_parameters.should_not include(@mstestpath)
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should include the list of assemblies" do
|
29
|
+
@command_parameters.should include("/testcontainer:\"#{@test_assembly}\"")
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should include the specific set of tests" do
|
33
|
+
@command_parameters.should include("/test:APassingTest /test:AFailingTest")
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should include the list of options" do
|
37
|
+
@command_parameters.should include(@test_option)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe MSTestTestRunner, "the command line string for an mstest runner" do
|
42
|
+
it_should_behave_like "mstest paths"
|
43
|
+
|
44
|
+
before :all do
|
45
|
+
mstest = MSTestTestRunner.new(@mstestpath)
|
46
|
+
mstest.assemblies @test_assembly
|
47
|
+
|
48
|
+
@command_line = mstest.get_command_line
|
49
|
+
@command_parameters = mstest.get_command_parameters.join(" ")
|
50
|
+
end
|
51
|
+
|
52
|
+
it "should start with the path to the command" do
|
53
|
+
@command_line.split(" ").first.should == @mstestpath
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should include the command parameters" do
|
57
|
+
@command_line.should include(@command_parameters)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
|
62
|
+
describe MSTestTestRunner, "when configured correctly" do
|
63
|
+
it_should_behave_like "mstest paths"
|
64
|
+
|
65
|
+
before :all do
|
66
|
+
mstest = MSTestTestRunner.new(@mstestpath)
|
67
|
+
mstest.extend(FailPatch)
|
68
|
+
mstest.assemblies @test_assembly
|
69
|
+
mstest.log_level = :verbose
|
70
|
+
mstest.tests "APassingTest"
|
71
|
+
mstest.execute
|
72
|
+
end
|
73
|
+
|
74
|
+
it "should execute" do
|
75
|
+
$task_failed.should be_false
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
describe MSTestTestRunner, "when configured correctly, but a test fails" do
|
80
|
+
it_should_behave_like "mstest paths"
|
81
|
+
|
82
|
+
before :all do
|
83
|
+
mstest = MSTestTestRunner.new(@mstestpath)
|
84
|
+
mstest.extend(FailPatch)
|
85
|
+
mstest.assemblies @test_assembly
|
86
|
+
mstest.log_level = :verbose
|
87
|
+
mstest.tests "AFailingTest"
|
88
|
+
mstest.execute
|
89
|
+
end
|
90
|
+
|
91
|
+
it "should fail" do
|
92
|
+
$task_failed.should be_true
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
describe MSTestTestRunner, "when using the configuration command and not providing a command in the intializer" do
|
97
|
+
it_should_behave_like "mstest paths"
|
98
|
+
|
99
|
+
before :all do
|
100
|
+
Albacore.configure do |config|
|
101
|
+
config.mstest.command = "configured command"
|
102
|
+
end
|
103
|
+
@mstest = MSTestTestRunner.new
|
104
|
+
end
|
105
|
+
|
106
|
+
it "should use the configuration command" do
|
107
|
+
@mstest.command.should == "configured command"
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
describe MSTestTestRunner, "when the command has been set through configuration and providing a command in the intializer" do
|
112
|
+
it_should_behave_like "mstest paths"
|
113
|
+
|
114
|
+
before :all do
|
115
|
+
Albacore.configure do |config|
|
116
|
+
config.mstest.command = "configured command"
|
117
|
+
end
|
118
|
+
@mstest = MSTestTestRunner.new("initializer command")
|
119
|
+
end
|
120
|
+
|
121
|
+
it "should use the initializer command" do
|
122
|
+
@mstest.command.should == "initializer command"
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
describe MSTestTestRunner, "when configuration has been provided" do
|
127
|
+
before :all do
|
128
|
+
Albacore.configure do |config|
|
129
|
+
config.mstest do |mstest|
|
130
|
+
mstest.assemblies = ["foo.dll", "bar.dll"]
|
131
|
+
mstest.options = ["/test"]
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
@mstest = MSTestTestRunner.new
|
136
|
+
end
|
137
|
+
|
138
|
+
it "should use the provided configuration" do
|
139
|
+
@mstest.assemblies.should == ["foo.dll", "bar.dll"]
|
140
|
+
@mstest.options.should == ["/test"]
|
141
|
+
end
|
142
|
+
end
|
data/spec/nant_spec.rb
CHANGED
@@ -1,110 +1,110 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'albacore/nant'
|
3
|
-
require 'nanttestdata'
|
4
|
-
|
5
|
-
shared_examples_for "prepping nant" do
|
6
|
-
before :all do
|
7
|
-
@testdata = NAntTestData.new
|
8
|
-
@nant = @testdata.nant
|
9
|
-
@strio = StringIO.new
|
10
|
-
@nant.log_device = @strio
|
11
|
-
end
|
12
|
-
|
13
|
-
after :all do
|
14
|
-
@testdata.clean_output
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
describe NAnt, "when a nant path is not specified" do
|
19
|
-
it_should_behave_like "prepping nant"
|
20
|
-
|
21
|
-
before :all do
|
22
|
-
@nant.extend(FailPatch)
|
23
|
-
@log_data = @strio.string
|
24
|
-
@nant.execute
|
25
|
-
end
|
26
|
-
|
27
|
-
it "should fail" do
|
28
|
-
$task_failed.should == true
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
describe NAnt, "when running a nant build file" do
|
33
|
-
it_should_behave_like "prepping nant"
|
34
|
-
|
35
|
-
before :all do
|
36
|
-
@nant.command = @testdata.nant_path
|
37
|
-
@nant.build_file = @testdata.build_file_path
|
38
|
-
@nant.execute
|
39
|
-
end
|
40
|
-
|
41
|
-
it "should execute the default task" do
|
42
|
-
File.exists?("#{@testdata.output_path}/buildfile.txt").should be_true
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
describe NAnt, "when running specific targets" do
|
47
|
-
it_should_behave_like "prepping nant"
|
48
|
-
|
49
|
-
before :all do
|
50
|
-
@nant.command = @testdata.nant_path
|
51
|
-
@nant.build_file = @testdata.build_file_path
|
52
|
-
@nant.targets :build, :other
|
53
|
-
@nant.execute
|
54
|
-
end
|
55
|
-
|
56
|
-
it "should execute the first task" do
|
57
|
-
File.exists?("#{@testdata.output_path}/buildfile.txt").should be_true
|
58
|
-
end
|
59
|
-
|
60
|
-
it "should execute the second task" do
|
61
|
-
File.exists?("#{@testdata.output_path}/otherfile.txt").should be_true
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
describe NAnt, "when specifying multiple configuration properties" do
|
66
|
-
|
67
|
-
before :all do
|
68
|
-
@testdata = NAntTestData.new(:fast,"1.2.3")
|
69
|
-
@nant = @testdata.nant
|
70
|
-
@strio = StringIO.new
|
71
|
-
@nant.log_device = @strio
|
72
|
-
@nant.command = @testdata.nant_path
|
73
|
-
@nant.build_file = @testdata.build_file_path
|
74
|
-
|
75
|
-
@nant.properties :version => "1.2.3", "build.mode" => :fast, :debug => false
|
76
|
-
@nant.execute
|
77
|
-
end
|
78
|
-
|
79
|
-
it "should spedify the first property" do
|
80
|
-
@nant.system_command.should include("-D:version=1.2.3")
|
81
|
-
end
|
82
|
-
|
83
|
-
it "should spedify the second property" do
|
84
|
-
@nant.system_command.should include("-D:build.mode=fast")
|
85
|
-
end
|
86
|
-
|
87
|
-
it "should spedify the last property" do
|
88
|
-
@nant.system_command.should include("-D:debug=false")
|
89
|
-
end
|
90
|
-
|
91
|
-
it "should create the output file" do
|
92
|
-
File.exists?("#{@testdata.output_path}/buildfile.txt").should be_true
|
93
|
-
end
|
94
|
-
|
95
|
-
after :all do
|
96
|
-
@testdata.clean_output
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
describe NAnt, "when providing configuration for nant" do
|
101
|
-
let :nant do
|
102
|
-
Albacore.configure do |config|
|
103
|
-
config.nant.command = "configured"
|
104
|
-
end
|
105
|
-
nant = NAnt.new
|
106
|
-
end
|
107
|
-
it "should use the configured value" do
|
108
|
-
nant.command.should == "configured"
|
109
|
-
end
|
110
|
-
end
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'albacore/nant'
|
3
|
+
require 'nanttestdata'
|
4
|
+
|
5
|
+
shared_examples_for "prepping nant" do
|
6
|
+
before :all do
|
7
|
+
@testdata = NAntTestData.new
|
8
|
+
@nant = @testdata.nant
|
9
|
+
@strio = StringIO.new
|
10
|
+
@nant.log_device = @strio
|
11
|
+
end
|
12
|
+
|
13
|
+
after :all do
|
14
|
+
@testdata.clean_output
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe NAnt, "when a nant path is not specified" do
|
19
|
+
it_should_behave_like "prepping nant"
|
20
|
+
|
21
|
+
before :all do
|
22
|
+
@nant.extend(FailPatch)
|
23
|
+
@log_data = @strio.string
|
24
|
+
@nant.execute
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should fail" do
|
28
|
+
$task_failed.should == true
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
describe NAnt, "when running a nant build file" do
|
33
|
+
it_should_behave_like "prepping nant"
|
34
|
+
|
35
|
+
before :all do
|
36
|
+
@nant.command = @testdata.nant_path
|
37
|
+
@nant.build_file = @testdata.build_file_path
|
38
|
+
@nant.execute
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should execute the default task" do
|
42
|
+
File.exists?("#{@testdata.output_path}/buildfile.txt").should be_true
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
describe NAnt, "when running specific targets" do
|
47
|
+
it_should_behave_like "prepping nant"
|
48
|
+
|
49
|
+
before :all do
|
50
|
+
@nant.command = @testdata.nant_path
|
51
|
+
@nant.build_file = @testdata.build_file_path
|
52
|
+
@nant.targets :build, :other
|
53
|
+
@nant.execute
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should execute the first task" do
|
57
|
+
File.exists?("#{@testdata.output_path}/buildfile.txt").should be_true
|
58
|
+
end
|
59
|
+
|
60
|
+
it "should execute the second task" do
|
61
|
+
File.exists?("#{@testdata.output_path}/otherfile.txt").should be_true
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
describe NAnt, "when specifying multiple configuration properties" do
|
66
|
+
|
67
|
+
before :all do
|
68
|
+
@testdata = NAntTestData.new(:fast,"1.2.3")
|
69
|
+
@nant = @testdata.nant
|
70
|
+
@strio = StringIO.new
|
71
|
+
@nant.log_device = @strio
|
72
|
+
@nant.command = @testdata.nant_path
|
73
|
+
@nant.build_file = @testdata.build_file_path
|
74
|
+
|
75
|
+
@nant.properties :version => "1.2.3", "build.mode" => :fast, :debug => false
|
76
|
+
@nant.execute
|
77
|
+
end
|
78
|
+
|
79
|
+
it "should spedify the first property" do
|
80
|
+
@nant.system_command.should include("-D:version=1.2.3")
|
81
|
+
end
|
82
|
+
|
83
|
+
it "should spedify the second property" do
|
84
|
+
@nant.system_command.should include("-D:build.mode=fast")
|
85
|
+
end
|
86
|
+
|
87
|
+
it "should spedify the last property" do
|
88
|
+
@nant.system_command.should include("-D:debug=false")
|
89
|
+
end
|
90
|
+
|
91
|
+
it "should create the output file" do
|
92
|
+
File.exists?("#{@testdata.output_path}/buildfile.txt").should be_true
|
93
|
+
end
|
94
|
+
|
95
|
+
after :all do
|
96
|
+
@testdata.clean_output
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
describe NAnt, "when providing configuration for nant" do
|
101
|
+
let :nant do
|
102
|
+
Albacore.configure do |config|
|
103
|
+
config.nant.command = "configured"
|
104
|
+
end
|
105
|
+
nant = NAnt.new
|
106
|
+
end
|
107
|
+
it "should use the configured value" do
|
108
|
+
nant.command.should == "configured"
|
109
|
+
end
|
110
|
+
end
|