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
data/spec/docu_spec.rb
CHANGED
@@ -1,109 +1,109 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'albacore/docu'
|
3
|
-
require 'docu_patch'
|
4
|
-
|
5
|
-
describe Docu, "when building docs without any assemblies specified" do
|
6
|
-
before :all do
|
7
|
-
@docu = Docu.new
|
8
|
-
@docu.execute
|
9
|
-
end
|
10
|
-
|
11
|
-
it "should fail with a missing assemblies message" do
|
12
|
-
@docu.failed.should be_true
|
13
|
-
@docu.failure_message.should eql('Docu Failed. No assemblies specified')
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe Docu, "when building docs fails" do
|
18
|
-
before :all do
|
19
|
-
@docu = Docu.new
|
20
|
-
@docu.command_result = false
|
21
|
-
@docu.assemblies 'test.dll'
|
22
|
-
@docu.execute
|
23
|
-
end
|
24
|
-
|
25
|
-
it "should fail with a generic message" do
|
26
|
-
@docu.failed.should be_true
|
27
|
-
@docu.failure_message.should eql('Docu Failed. See Build Log For Detail')
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
describe Docu, "when building docs with assemblies specified" do
|
32
|
-
before :all do
|
33
|
-
@docu = Docu.new
|
34
|
-
@docu.command_result = true
|
35
|
-
@docu.assemblies 'test.dll'
|
36
|
-
@docu.execute
|
37
|
-
end
|
38
|
-
|
39
|
-
it "should pass the assemblies in the command-line arguments" do
|
40
|
-
@docu.command_parameters.should include('test.dll')
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
describe Docu, "when building docs with assemblies and xml files specified" do
|
45
|
-
before :all do
|
46
|
-
@docu = Docu.new
|
47
|
-
@docu.command_result = true
|
48
|
-
@docu.xml_files 'test.xml'
|
49
|
-
@docu.assemblies 'test.dll'
|
50
|
-
@docu.execute
|
51
|
-
end
|
52
|
-
|
53
|
-
it "should pass the xml files in the command-line arguments after the assemblies" do
|
54
|
-
@docu.command_parameters.should include('test.dll test.xml')
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
describe Docu, "when building docs with an output location specified" do
|
59
|
-
before :all do
|
60
|
-
@docu = Docu.new
|
61
|
-
@docu.command_result = true
|
62
|
-
@docu.assemblies 'test.dll'
|
63
|
-
@docu.output_location = 'output_location'
|
64
|
-
@docu.execute
|
65
|
-
end
|
66
|
-
|
67
|
-
it "should pass the output location using the --output switch" do
|
68
|
-
@docu.command_parameters.should include('--output="output_location"')
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
describe Docu, "when no command has been specified" do
|
73
|
-
let :docu do
|
74
|
-
docu = Docu.new
|
75
|
-
docu
|
76
|
-
end
|
77
|
-
|
78
|
-
it "should default to the standard docu.exe" do
|
79
|
-
docu.command.should == "Docu.exe"
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
describe Docu, "when the command has been provided through configuration" do
|
84
|
-
let :docu do
|
85
|
-
Albacore.configure do |config|
|
86
|
-
config.docu.command = "configured"
|
87
|
-
end
|
88
|
-
docu = Docu.new
|
89
|
-
docu
|
90
|
-
end
|
91
|
-
|
92
|
-
it "should use the configured command" do
|
93
|
-
docu.command.should == "configured"
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|
97
|
-
describe Docu, "when the command has been provided through configuration and is overriden through the initializer" do
|
98
|
-
let :docu do
|
99
|
-
Albacore.configure do |config|
|
100
|
-
config.docu.command = "configured"
|
101
|
-
end
|
102
|
-
docu = Docu.new("override")
|
103
|
-
docu
|
104
|
-
end
|
105
|
-
|
106
|
-
it "should use the override" do
|
107
|
-
docu.command.should == "override"
|
108
|
-
end
|
109
|
-
end
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'albacore/docu'
|
3
|
+
require 'docu_patch'
|
4
|
+
|
5
|
+
describe Docu, "when building docs without any assemblies specified" do
|
6
|
+
before :all do
|
7
|
+
@docu = Docu.new
|
8
|
+
@docu.execute
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should fail with a missing assemblies message" do
|
12
|
+
@docu.failed.should be_true
|
13
|
+
@docu.failure_message.should eql('Docu Failed. No assemblies specified')
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
describe Docu, "when building docs fails" do
|
18
|
+
before :all do
|
19
|
+
@docu = Docu.new
|
20
|
+
@docu.command_result = false
|
21
|
+
@docu.assemblies 'test.dll'
|
22
|
+
@docu.execute
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should fail with a generic message" do
|
26
|
+
@docu.failed.should be_true
|
27
|
+
@docu.failure_message.should eql('Docu Failed. See Build Log For Detail')
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe Docu, "when building docs with assemblies specified" do
|
32
|
+
before :all do
|
33
|
+
@docu = Docu.new
|
34
|
+
@docu.command_result = true
|
35
|
+
@docu.assemblies 'test.dll'
|
36
|
+
@docu.execute
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should pass the assemblies in the command-line arguments" do
|
40
|
+
@docu.command_parameters.should include('test.dll')
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
describe Docu, "when building docs with assemblies and xml files specified" do
|
45
|
+
before :all do
|
46
|
+
@docu = Docu.new
|
47
|
+
@docu.command_result = true
|
48
|
+
@docu.xml_files 'test.xml'
|
49
|
+
@docu.assemblies 'test.dll'
|
50
|
+
@docu.execute
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should pass the xml files in the command-line arguments after the assemblies" do
|
54
|
+
@docu.command_parameters.should include('test.dll test.xml')
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
describe Docu, "when building docs with an output location specified" do
|
59
|
+
before :all do
|
60
|
+
@docu = Docu.new
|
61
|
+
@docu.command_result = true
|
62
|
+
@docu.assemblies 'test.dll'
|
63
|
+
@docu.output_location = 'output_location'
|
64
|
+
@docu.execute
|
65
|
+
end
|
66
|
+
|
67
|
+
it "should pass the output location using the --output switch" do
|
68
|
+
@docu.command_parameters.should include('--output="output_location"')
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
describe Docu, "when no command has been specified" do
|
73
|
+
let :docu do
|
74
|
+
docu = Docu.new
|
75
|
+
docu
|
76
|
+
end
|
77
|
+
|
78
|
+
it "should default to the standard docu.exe" do
|
79
|
+
docu.command.should == "Docu.exe"
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
describe Docu, "when the command has been provided through configuration" do
|
84
|
+
let :docu do
|
85
|
+
Albacore.configure do |config|
|
86
|
+
config.docu.command = "configured"
|
87
|
+
end
|
88
|
+
docu = Docu.new
|
89
|
+
docu
|
90
|
+
end
|
91
|
+
|
92
|
+
it "should use the configured command" do
|
93
|
+
docu.command.should == "configured"
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
describe Docu, "when the command has been provided through configuration and is overriden through the initializer" do
|
98
|
+
let :docu do
|
99
|
+
Albacore.configure do |config|
|
100
|
+
config.docu.command = "configured"
|
101
|
+
end
|
102
|
+
docu = Docu.new("override")
|
103
|
+
docu
|
104
|
+
end
|
105
|
+
|
106
|
+
it "should use the override" do
|
107
|
+
docu.command.should == "override"
|
108
|
+
end
|
109
|
+
end
|
data/spec/exec_spec.rb
CHANGED
@@ -1,45 +1,45 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'albacore/exec'
|
3
|
-
|
4
|
-
describe Exec, "when executing a command with parameters" do
|
5
|
-
before :all do
|
6
|
-
@nunit = File.join(File.dirname(__FILE__), 'support', 'Tools', 'NUnit-v2.5', 'nunit-console-x86.exe')
|
7
|
-
|
8
|
-
@cmd = Exec.new
|
9
|
-
@cmd.log_level = :verbose
|
10
|
-
@cmd.extend(SystemPatch)
|
11
|
-
@cmd.extend(FailPatch)
|
12
|
-
@cmd.command = @nunit
|
13
|
-
@cmd.parameters "--help"
|
14
|
-
@cmd.execute
|
15
|
-
end
|
16
|
-
|
17
|
-
it "should run the command with the parameters" do
|
18
|
-
@cmd.system_command.should include("\"#{File.expand_path(@nunit)}\" --help")
|
19
|
-
end
|
20
|
-
|
21
|
-
it "should specify the parameters only once" do
|
22
|
-
@cmd.system_command.scan(/--help/).length.should be(1)
|
23
|
-
end
|
24
|
-
|
25
|
-
it "should not fail" do
|
26
|
-
$task_failed.should be_false
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
describe Exec, "when providing configuration" do
|
31
|
-
let :exec do
|
32
|
-
Albacore.configure do |config|
|
33
|
-
config.exec do |exe|
|
34
|
-
exe.command = "foo.exe"
|
35
|
-
exe.parameters = ["bar", "baz"]
|
36
|
-
end
|
37
|
-
end
|
38
|
-
exec = Exec.new
|
39
|
-
end
|
40
|
-
|
41
|
-
it "should use the configuration" do
|
42
|
-
exec.command.should == "foo.exe"
|
43
|
-
exec.parameters.should == ["bar", "baz"]
|
44
|
-
end
|
45
|
-
end
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'albacore/exec'
|
3
|
+
|
4
|
+
describe Exec, "when executing a command with parameters" do
|
5
|
+
before :all do
|
6
|
+
@nunit = File.join(File.dirname(__FILE__), 'support', 'Tools', 'NUnit-v2.5', 'nunit-console-x86.exe')
|
7
|
+
|
8
|
+
@cmd = Exec.new
|
9
|
+
@cmd.log_level = :verbose
|
10
|
+
@cmd.extend(SystemPatch)
|
11
|
+
@cmd.extend(FailPatch)
|
12
|
+
@cmd.command = @nunit
|
13
|
+
@cmd.parameters "--help"
|
14
|
+
@cmd.execute
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should run the command with the parameters" do
|
18
|
+
@cmd.system_command.should include("\"#{File.expand_path(@nunit)}\" --help")
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should specify the parameters only once" do
|
22
|
+
@cmd.system_command.scan(/--help/).length.should be(1)
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should not fail" do
|
26
|
+
$task_failed.should be_false
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe Exec, "when providing configuration" do
|
31
|
+
let :exec do
|
32
|
+
Albacore.configure do |config|
|
33
|
+
config.exec do |exe|
|
34
|
+
exe.command = "foo.exe"
|
35
|
+
exe.parameters = ["bar", "baz"]
|
36
|
+
end
|
37
|
+
end
|
38
|
+
exec = Exec.new
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should use the configuration" do
|
42
|
+
exec.command.should == "foo.exe"
|
43
|
+
exec.parameters.should == ["bar", "baz"]
|
44
|
+
end
|
45
|
+
end
|
@@ -1,185 +1,254 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'albacore/fluentmigratorrunner'
|
3
|
-
|
4
|
-
shared_examples_for "fluentmigrator paths" do
|
5
|
-
before :all do
|
6
|
-
@fluent_migrator_path = File.join(File.dirname(__FILE__), 'support', 'Tools', 'FluentMigrator-0.9', 'Migrate.exe')
|
7
|
-
@test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'CodeCoverage', 'fluentmigrator', 'assemblies', 'TestSolution.FluentMigrator.dll')
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
describe FluentMigratorRunner, "the command parameters for an migrator runner" do
|
12
|
-
it_should_behave_like "fluentmigrator paths"
|
13
|
-
|
14
|
-
before :all do
|
15
|
-
@migrator = FluentMigratorRunner.new(@fluent_migrator_path)
|
16
|
-
end
|
17
|
-
|
18
|
-
context "Required params" do
|
19
|
-
before :all do
|
20
|
-
@command_parameters = @migrator.get_command_parameters
|
21
|
-
end
|
22
|
-
|
23
|
-
it "doesn't include command" do
|
24
|
-
@command_parameters.should_not include(@fluent_migrator_path)
|
25
|
-
end
|
26
|
-
|
27
|
-
it "includes target" do
|
28
|
-
@command_parameters.should include("/target")
|
29
|
-
end
|
30
|
-
|
31
|
-
it "includes provider" do
|
32
|
-
@command_parameters.should include("/provider")
|
33
|
-
end
|
34
|
-
|
35
|
-
it "includes connection" do
|
36
|
-
@command_parameters.should include("/connection")
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
context "Optional options" do
|
41
|
-
before :all do
|
42
|
-
@migrator.namespace = 'namespace'
|
43
|
-
@migrator.output =
|
44
|
-
@migrator.
|
45
|
-
@migrator.
|
46
|
-
@migrator.
|
47
|
-
@migrator.
|
48
|
-
@migrator.
|
49
|
-
@migrator.
|
50
|
-
@migrator.
|
51
|
-
@migrator.
|
52
|
-
@
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
@migrator.
|
174
|
-
@migrator.
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
@
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
@
|
183
|
-
|
184
|
-
|
185
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'albacore/fluentmigratorrunner'
|
3
|
+
|
4
|
+
shared_examples_for "fluentmigrator paths" do
|
5
|
+
before :all do
|
6
|
+
@fluent_migrator_path = File.join(File.dirname(__FILE__), 'support', 'Tools', 'FluentMigrator-0.9', 'Migrate.exe')
|
7
|
+
@test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'CodeCoverage', 'fluentmigrator', 'assemblies', 'TestSolution.FluentMigrator.dll')
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
describe FluentMigratorRunner, "the command parameters for an migrator runner" do
|
12
|
+
it_should_behave_like "fluentmigrator paths"
|
13
|
+
|
14
|
+
before :all do
|
15
|
+
@migrator = FluentMigratorRunner.new(@fluent_migrator_path)
|
16
|
+
end
|
17
|
+
|
18
|
+
context "Required params" do
|
19
|
+
before :all do
|
20
|
+
@command_parameters = @migrator.get_command_parameters
|
21
|
+
end
|
22
|
+
|
23
|
+
it "doesn't include command" do
|
24
|
+
@command_parameters.should_not include(@fluent_migrator_path)
|
25
|
+
end
|
26
|
+
|
27
|
+
it "includes target" do
|
28
|
+
@command_parameters.should include("/target")
|
29
|
+
end
|
30
|
+
|
31
|
+
it "includes provider" do
|
32
|
+
@command_parameters.should include("/provider")
|
33
|
+
end
|
34
|
+
|
35
|
+
it "includes connection" do
|
36
|
+
@command_parameters.should include("/connection")
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
context "Optional options" do
|
41
|
+
before :all do
|
42
|
+
@migrator.namespace = 'namespace'
|
43
|
+
@migrator.output = true
|
44
|
+
@migrator.output_filename = "output.txt"
|
45
|
+
@migrator.preview = true
|
46
|
+
@migrator.steps = 1
|
47
|
+
@migrator.task = 'migrate:up'
|
48
|
+
@migrator.version = '001'
|
49
|
+
@migrator.verbose = true
|
50
|
+
@migrator.script_directory = 'c:\scripts'
|
51
|
+
@migrator.profile = 'MyProfile'
|
52
|
+
@migrator.timeout = 90
|
53
|
+
@command_parameters = @migrator.get_command_parameters
|
54
|
+
end
|
55
|
+
|
56
|
+
it "includes ns" do
|
57
|
+
@command_parameters.should include('/ns')
|
58
|
+
end
|
59
|
+
|
60
|
+
it "includes out" do
|
61
|
+
@command_parameters.should include('/out')
|
62
|
+
end
|
63
|
+
|
64
|
+
it "includes outfile" do
|
65
|
+
@command_parameters.should include('/outfile')
|
66
|
+
end
|
67
|
+
|
68
|
+
it "includes preview" do
|
69
|
+
@command_parameters.should include('/preview')
|
70
|
+
end
|
71
|
+
|
72
|
+
it "includes steps" do
|
73
|
+
@command_parameters.should include('/steps')
|
74
|
+
end
|
75
|
+
|
76
|
+
it "includes task" do
|
77
|
+
@command_parameters.should include('/task')
|
78
|
+
end
|
79
|
+
|
80
|
+
it "includes version" do
|
81
|
+
@command_parameters.should include('/version')
|
82
|
+
end
|
83
|
+
|
84
|
+
it "includes verbose" do
|
85
|
+
@command_parameters.should include('/verbose')
|
86
|
+
end
|
87
|
+
|
88
|
+
it "includes wd" do
|
89
|
+
@command_parameters.should include('/wd')
|
90
|
+
end
|
91
|
+
|
92
|
+
it "includes profile" do
|
93
|
+
@command_parameters.should include('/profile')
|
94
|
+
end
|
95
|
+
|
96
|
+
it "includes timeout" do
|
97
|
+
@command_parameters.should include('/timeout')
|
98
|
+
end
|
99
|
+
|
100
|
+
it "excludes help" do
|
101
|
+
@command_parameters.should_not include("/?")
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
context "Help option" do
|
106
|
+
it "includes help flag when specifed" do
|
107
|
+
@migrator.show_help = true
|
108
|
+
command_parameters = @migrator.get_command_parameters
|
109
|
+
command_parameters.should == " /?"
|
110
|
+
end
|
111
|
+
|
112
|
+
it "excludes help flag when not specifed" do
|
113
|
+
@migrator.show_help = false
|
114
|
+
command_parameters = @migrator.get_command_parameters
|
115
|
+
command_parameters.should_not include "/?"
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
context "Boolean options" do
|
120
|
+
before :all do
|
121
|
+
@migrator.output = false
|
122
|
+
@migrator.preview = false
|
123
|
+
@migrator.verbose = false
|
124
|
+
end
|
125
|
+
|
126
|
+
it "includes /out when output is true" do
|
127
|
+
@migrator.output = true
|
128
|
+
@migrator.get_command_parameters.should include "/out"
|
129
|
+
end
|
130
|
+
|
131
|
+
it "excludes /out when output not true" do
|
132
|
+
@migrator.output = false
|
133
|
+
@migrator.get_command_parameters.should_not include "/out"
|
134
|
+
@migrator.output = "a"
|
135
|
+
@migrator.get_command_parameters.should_not include "/out"
|
136
|
+
end
|
137
|
+
|
138
|
+
it "includes /preview when preview is true" do
|
139
|
+
@migrator.preview = true
|
140
|
+
@migrator.get_command_parameters.should include "/preview"
|
141
|
+
end
|
142
|
+
|
143
|
+
it "excludes /preview when preview is not true" do
|
144
|
+
@migrator.preview = false
|
145
|
+
@migrator.get_command_parameters.should_not include "/preview"
|
146
|
+
|
147
|
+
@migrator.preview = "a"
|
148
|
+
@migrator.get_command_parameters.should_not include "/preview"
|
149
|
+
end
|
150
|
+
|
151
|
+
it "includes /verbose when verbose is true" do
|
152
|
+
@migrator.verbose = true
|
153
|
+
@migrator.get_command_parameters.should include "/verbose=true"
|
154
|
+
end
|
155
|
+
|
156
|
+
it "excludes /verbose when verbose is not true" do
|
157
|
+
@migrator.verbose = false
|
158
|
+
@migrator.get_command_parameters.should_not include "/verbose="
|
159
|
+
|
160
|
+
@migrator.verbose = "a"
|
161
|
+
@migrator.get_command_parameters.should_not include "/verbose="
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
describe FluentMigratorRunner, "the command line string for an fluentmigrator runner" do
|
167
|
+
it_should_behave_like "fluentmigrator paths"
|
168
|
+
|
169
|
+
before :all do
|
170
|
+
migrator = FluentMigratorRunner.new(@fluent_migrator_path)
|
171
|
+
migrator.target = @test_assembly
|
172
|
+
|
173
|
+
@command_line = migrator.get_command_line
|
174
|
+
@command_parameters = migrator.get_command_parameters
|
175
|
+
end
|
176
|
+
|
177
|
+
it "starts with the path to the command" do
|
178
|
+
@command_line.should =~ /^#{@fluent_migrator_path}.*$/
|
179
|
+
end
|
180
|
+
|
181
|
+
it "includes the command parameters" do
|
182
|
+
@command_line.downcase.should include(@command_parameters.downcase)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
describe FluentMigratorRunner, "when using the configuration command and not providing a command in the intializer" do
|
187
|
+
it_should_behave_like "fluentmigrator paths"
|
188
|
+
|
189
|
+
before :all do
|
190
|
+
Albacore.configure do |config|
|
191
|
+
config.fluentmigrator.command = "configured command"
|
192
|
+
end
|
193
|
+
@migrator = FluentMigratorRunner.new
|
194
|
+
end
|
195
|
+
|
196
|
+
it "uses the configuration command" do
|
197
|
+
@migrator.command.should == "configured command"
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
describe FluentMigratorRunner, "when the command has been set through configuration and providing a command in the intializer" do
|
202
|
+
it_should_behave_like "fluentmigrator paths"
|
203
|
+
|
204
|
+
before :all do
|
205
|
+
Albacore.configure do |config|
|
206
|
+
config.fluentmigrator.command = "configured command"
|
207
|
+
end
|
208
|
+
@migrator = FluentMigratorRunner.new("initializer command")
|
209
|
+
end
|
210
|
+
|
211
|
+
it "uses the initializer command" do
|
212
|
+
@migrator.command.should == "initializer command"
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
describe FluentMigratorRunner, "when configuration has been provided" do
|
217
|
+
before :all do
|
218
|
+
Albacore.configure do |config|
|
219
|
+
config.fluentmigrator do |migrator|
|
220
|
+
migrator.target = 'target.dll'
|
221
|
+
migrator.provider = 'provider'
|
222
|
+
migrator.connection = 'connection'
|
223
|
+
migrator.namespace = 'namespace'
|
224
|
+
migrator.output = 'output.txt'
|
225
|
+
migrator.preview = true
|
226
|
+
migrator.steps = 1
|
227
|
+
migrator.task = 'migrate:up'
|
228
|
+
migrator.version = '001'
|
229
|
+
migrator.verbose = true
|
230
|
+
migrator.script_directory = 'c:\scripts'
|
231
|
+
migrator.profile = 'MyProfile'
|
232
|
+
migrator.timeout = 90
|
233
|
+
end
|
234
|
+
end
|
235
|
+
|
236
|
+
@migrator = FluentMigratorRunner.new
|
237
|
+
end
|
238
|
+
|
239
|
+
it "uses the provided configuration" do
|
240
|
+
@migrator.target.should == 'target.dll'
|
241
|
+
@migrator.provider.should == 'provider'
|
242
|
+
@migrator.connection.should == 'connection'
|
243
|
+
@migrator.namespace.should == 'namespace'
|
244
|
+
@migrator.output.should == 'output.txt'
|
245
|
+
@migrator.preview.should == true
|
246
|
+
@migrator.steps.should == 1
|
247
|
+
@migrator.task.should == 'migrate:up'
|
248
|
+
@migrator.version.should == '001'
|
249
|
+
@migrator.verbose.should == true
|
250
|
+
@migrator.script_directory.should == 'c:\scripts'
|
251
|
+
@migrator.profile.should == 'MyProfile'
|
252
|
+
@migrator.timeout.should == 90
|
253
|
+
end
|
254
|
+
end
|