albacore 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. data/.bundle/config +2 -0
  2. data/.travis.yml +1 -0
  3. data/Gemfile +4 -1
  4. data/lib/albacore/assemblyinfo.rb +2 -1
  5. data/lib/albacore/config/netversion.rb +11 -8
  6. data/lib/albacore/output.rb +17 -14
  7. data/lib/albacore/sqlcmd.rb +3 -1
  8. data/lib/albacore/xunittestrunner.rb +4 -0
  9. data/lib/version.rb +1 -1
  10. data/spec/assemblyinfo_spec.rb +9 -0
  11. data/spec/msbuild_spec.rb +287 -287
  12. data/spec/mstesttestrunner_spec.rb +144 -144
  13. data/spec/netversion_spec.rb +53 -0
  14. data/spec/nugetinstall_spec.rb +46 -46
  15. data/spec/output_spec.rb +30 -0
  16. data/spec/sqlcmd_spec.rb +1 -1
  17. data/spec/support/CodeCoverage/xunit/assemblies/xunit.xml +2604 -2604
  18. data/spec/support/TestSolution/LocalTestRun.testrunconfig +4 -4
  19. data/spec/support/TestSolution/TestSolution.FailingTests/TestSolution.FailingTests.csproj +94 -94
  20. data/spec/support/TestSolution/TestSolution.FluentMigrator/TestSolution.FluentMigrator.csproj +94 -94
  21. data/spec/support/TestSolution/TestSolution.MSTestTests.NET40/Properties/AssemblyInfo.cs +36 -36
  22. data/spec/support/TestSolution/TestSolution.MSTestTests.NET40/TestSolution.MSTestTests.NET40.csproj +52 -52
  23. data/spec/support/TestSolution/TestSolution.MSTestTests/TestSolution.MSTestTests.csproj +90 -90
  24. data/spec/support/TestSolution/TestSolution.MSpecTests/TestSolution.MSpecTests.csproj +103 -103
  25. data/spec/support/TestSolution/TestSolution.SpecFlow/TestSolution.SpecFlow.csproj +115 -115
  26. data/spec/support/TestSolution/TestSolution.Tests/TestSolution.Tests.csproj +100 -100
  27. data/spec/support/TestSolution/TestSolution.XUnitTests/TestSolution.XUnitTests.csproj +101 -101
  28. data/spec/support/TestSolution/TestSolution.sln +75 -75
  29. data/spec/support/TestSolution/TestSolution.vsmdi +5 -5
  30. data/spec/support/TestSolution/TestSolution/TestSolution.csproj +90 -90
  31. data/spec/support/Tools/MSTest-2010/MSTest.exe.config +31 -31
  32. data/spec/support/Tools/MSTest-2010/Microsoft.VisualStudio.QualityTools.LoadTestExcelAddIn.dll.manifest +251 -251
  33. data/spec/support/Tools/MSTest-2010/Microsoft.VisualStudio.QualityTools.LoadTestExcelAddIn.vsto +105 -105
  34. data/spec/support/Tools/Machine.Specifications-0.5.3/lib/Machine.Specifications.dll.tdnet +5 -5
  35. data/spec/support/Tools/Machine.Specifications-0.5.3/tools/CommandLine.xml +504 -504
  36. data/spec/support/Tools/Machine.Specifications-0.5.3/tools/InstallResharperRunner.4.1.bat +4 -4
  37. data/spec/support/Tools/Machine.Specifications-0.5.3/tools/InstallResharperRunner.4.5.bat +4 -4
  38. data/spec/support/Tools/Machine.Specifications-0.5.3/tools/InstallResharperRunner.5.0 - VS2008.bat +4 -4
  39. data/spec/support/Tools/Machine.Specifications-0.5.3/tools/InstallResharperRunner.5.0 - VS2010.bat +4 -4
  40. data/spec/support/Tools/Machine.Specifications-0.5.3/tools/InstallResharperRunner.5.1 - VS2008.bat +4 -4
  41. data/spec/support/Tools/Machine.Specifications-0.5.3/tools/InstallResharperRunner.5.1 - VS2010.bat +4 -4
  42. data/spec/support/Tools/Machine.Specifications-0.5.3/tools/InstallResharperRunner.6.0 - VS2008.bat +4 -4
  43. data/spec/support/Tools/Machine.Specifications-0.5.3/tools/InstallResharperRunner.6.0 - VS2010.bat +4 -4
  44. data/spec/support/Tools/Machine.Specifications-0.5.3/tools/InstallResharperRunner.6.1 - VS2008.bat +4 -4
  45. data/spec/support/Tools/Machine.Specifications-0.5.3/tools/InstallResharperRunner.6.1 - VS2010.bat +4 -4
  46. data/spec/support/Tools/Machine.Specifications-0.5.3/tools/InstallTDNetRunner.bat +16 -16
  47. data/spec/support/Tools/Machine.Specifications-0.5.3/tools/InstallTDNetRunnerSilent.bat +16 -16
  48. data/spec/support/Tools/Machine.Specifications-0.5.3/tools/License.txt +53 -53
  49. data/spec/support/Tools/Machine.Specifications-0.5.3/tools/Machine.Specifications.GallioAdapter.plugin +42 -42
  50. data/spec/support/Tools/Machine.Specifications-0.5.3/tools/Machine.Specifications.dll.tdnet +5 -5
  51. data/spec/support/Tools/Machine.Specifications-0.5.3/tools/install.ps1 +5 -5
  52. data/spec/support/Tools/XUnit-v1.9/EULA.txt +28 -28
  53. data/spec/support/Tools/XUnit-v1.9/HTML.xslt +125 -125
  54. data/spec/support/Tools/XUnit-v1.9/NUnitXml.xslt +120 -120
  55. data/spec/support/Tools/XUnit-v1.9/xunit.console.clr4.exe.config +20 -20
  56. data/spec/support/Tools/XUnit-v1.9/xunit.console.clr4.x86.exe.config +20 -20
  57. data/spec/support/Tools/XUnit-v1.9/xunit.console.exe.config +20 -20
  58. data/spec/support/Tools/XUnit-v1.9/xunit.console.x86.exe.config +20 -20
  59. data/spec/support/Tools/XUnit-v1.9/xunit.dll.tdnet +4 -4
  60. data/spec/support/Tools/XUnit-v1.9/xunit.extensions.xml +805 -805
  61. data/spec/support/Tools/XUnit-v1.9/xunit.runner.utility.xml +1212 -1212
  62. data/spec/support/Tools/XUnit-v1.9/xunit.xml +2604 -2604
  63. data/spec/support/assemblyinfotester.rb +1 -0
  64. data/spec/xunit_spec.rb +38 -0
  65. metadata +14 -7
@@ -1,144 +1,144 @@
1
- require 'spec_helper'
2
- require 'albacore/mstesttestrunner'
3
-
4
- shared_context "mstest paths" do
5
- before :all do
6
- @mstestpath = File.join(File.dirname(__FILE__), 'support', 'Tools', 'MSTest-2010', 'mstest.exe')
7
- @test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'CodeCoverage', 'mstest', 'TestSolution.MSTestTests.NET40.dll')
8
- @test_option = "/test:Test /noisolation /noresults"
9
- end
10
- end
11
-
12
- describe MSTestTestRunner, "the command parameters for an mstest runner" do
13
- include_context "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
- include_context "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
- include_context "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.options "/noisolation /noresults"
71
- mstest.tests "APassingTest"
72
- mstest.execute
73
- end
74
-
75
- it "should execute" do
76
- $task_failed.should be_false
77
- end
78
- end
79
-
80
- describe MSTestTestRunner, "when configured correctly, but a test fails" do
81
- include_context "mstest paths"
82
-
83
- before :all do
84
- mstest = MSTestTestRunner.new(@mstestpath)
85
- mstest.extend(FailPatch)
86
- mstest.assemblies @test_assembly
87
- mstest.log_level = :verbose
88
- mstest.options "/noisolation /noresults"
89
- mstest.tests "AFailingTest"
90
- mstest.execute
91
- end
92
-
93
- it "should fail" do
94
- $task_failed.should be_true
95
- end
96
- end
97
-
98
- describe MSTestTestRunner, "when using the configuration command and not providing a command in the intializer" do
99
- include_context "mstest paths"
100
-
101
- before :all do
102
- Albacore.configure do |config|
103
- config.mstest.command = "configured command"
104
- end
105
- @mstest = MSTestTestRunner.new
106
- end
107
-
108
- it "should use the configuration command" do
109
- @mstest.command.should == "configured command"
110
- end
111
- end
112
-
113
- describe MSTestTestRunner, "when the command has been set through configuration and providing a command in the intializer" do
114
- include_context "mstest paths"
115
-
116
- before :all do
117
- Albacore.configure do |config|
118
- config.mstest.command = "configured command"
119
- end
120
- @mstest = MSTestTestRunner.new("initializer command")
121
- end
122
-
123
- it "should use the initializer command" do
124
- @mstest.command.should == "initializer command"
125
- end
126
- end
127
-
128
- describe MSTestTestRunner, "when configuration has been provided" do
129
- before :all do
130
- Albacore.configure do |config|
131
- config.mstest do |mstest|
132
- mstest.assemblies = ["foo.dll", "bar.dll"]
133
- mstest.options = ["/test"]
134
- end
135
- end
136
-
137
- @mstest = MSTestTestRunner.new
138
- end
139
-
140
- it "should use the provided configuration" do
141
- @mstest.assemblies.should == ["foo.dll", "bar.dll"]
142
- @mstest.options.should == ["/test"]
143
- end
144
- end
1
+ require 'spec_helper'
2
+ require 'albacore/mstesttestrunner'
3
+
4
+ shared_context "mstest paths" do
5
+ before :all do
6
+ @mstestpath = File.join(File.dirname(__FILE__), 'support', 'Tools', 'MSTest-2010', 'mstest.exe')
7
+ @test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'CodeCoverage', 'mstest', 'TestSolution.MSTestTests.NET40.dll')
8
+ @test_option = "/test:Test /noisolation /noresults"
9
+ end
10
+ end
11
+
12
+ describe MSTestTestRunner, "the command parameters for an mstest runner" do
13
+ include_context "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
+ include_context "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
+ include_context "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.options "/noisolation /noresults"
71
+ mstest.tests "APassingTest"
72
+ mstest.execute
73
+ end
74
+
75
+ it "should execute" do
76
+ $task_failed.should be_false
77
+ end
78
+ end
79
+
80
+ describe MSTestTestRunner, "when configured correctly, but a test fails" do
81
+ include_context "mstest paths"
82
+
83
+ before :all do
84
+ mstest = MSTestTestRunner.new(@mstestpath)
85
+ mstest.extend(FailPatch)
86
+ mstest.assemblies @test_assembly
87
+ mstest.log_level = :verbose
88
+ mstest.options "/noisolation /noresults"
89
+ mstest.tests "AFailingTest"
90
+ mstest.execute
91
+ end
92
+
93
+ it "should fail" do
94
+ $task_failed.should be_true
95
+ end
96
+ end
97
+
98
+ describe MSTestTestRunner, "when using the configuration command and not providing a command in the intializer" do
99
+ include_context "mstest paths"
100
+
101
+ before :all do
102
+ Albacore.configure do |config|
103
+ config.mstest.command = "configured command"
104
+ end
105
+ @mstest = MSTestTestRunner.new
106
+ end
107
+
108
+ it "should use the configuration command" do
109
+ @mstest.command.should == "configured command"
110
+ end
111
+ end
112
+
113
+ describe MSTestTestRunner, "when the command has been set through configuration and providing a command in the intializer" do
114
+ include_context "mstest paths"
115
+
116
+ before :all do
117
+ Albacore.configure do |config|
118
+ config.mstest.command = "configured command"
119
+ end
120
+ @mstest = MSTestTestRunner.new("initializer command")
121
+ end
122
+
123
+ it "should use the initializer command" do
124
+ @mstest.command.should == "initializer command"
125
+ end
126
+ end
127
+
128
+ describe MSTestTestRunner, "when configuration has been provided" do
129
+ before :all do
130
+ Albacore.configure do |config|
131
+ config.mstest do |mstest|
132
+ mstest.assemblies = ["foo.dll", "bar.dll"]
133
+ mstest.options = ["/test"]
134
+ end
135
+ end
136
+
137
+ @mstest = MSTestTestRunner.new
138
+ end
139
+
140
+ it "should use the provided configuration" do
141
+ @mstest.assemblies.should == ["foo.dll", "bar.dll"]
142
+ @mstest.options.should == ["/test"]
143
+ end
144
+ end
@@ -0,0 +1,53 @@
1
+ require 'spec_helper'
2
+ require 'albacore/config/netversion'
3
+
4
+ class NetVersionTest
5
+ include Configuration::NetVersion
6
+ end
7
+
8
+ describe :NetVersion, 'when getting the win_dir' do
9
+ before do
10
+ @subject = NetVersionTest.new
11
+ @win_dir = @subject.win_dir
12
+ end
13
+
14
+ it 'should be in the system path' do
15
+ @win_dir.upcase.should eq 'C:\\WINDOWS'
16
+ end
17
+ end
18
+
19
+ describe :NetVersion, 'when getting the net version' do
20
+ before do
21
+ @subject = NetVersionTest.new
22
+ end
23
+
24
+ it 'should have v2.0' do
25
+ @subject.get_net_version(:net2).should include 'v2.0'
26
+ end
27
+
28
+ it 'should have v3.0' do
29
+ @subject.get_net_version(:net3).should include 'v2.0'
30
+ end
31
+
32
+ it 'should have v3.5' do
33
+ @subject.get_net_version(:net35).should include 'v3.5'
34
+ end
35
+
36
+ it 'should have v4.0' do
37
+ @subject.get_net_version(:net4).should include 'v4.0'
38
+ end
39
+
40
+ it 'should have v4.5' do
41
+ @subject.get_net_version(:net45).should include 'v4.0'
42
+ end
43
+ end
44
+
45
+ describe :NetVersion, 'when getting an unsupported net version' do
46
+ before do
47
+ @subject = NetVersionTest.new
48
+ end
49
+
50
+ it 'should fail' do
51
+ lambda { @subject.get_net_version :fake }.should raise_error
52
+ end
53
+ end
@@ -1,47 +1,47 @@
1
- require 'spec_helper'
2
- require 'albacore/nugetinstall'
3
-
4
- describe NuGetInstall do
5
- before :each do
6
- @nugetinstall = NuGetInstall.new
7
- @strio = StringIO.new
8
- @nugetinstall.log_device = @strio
9
- @nugetinstall.log_level = :diagnostic
10
- end
11
-
12
- context "when no path to NuGet is specified" do
13
- it "assumes NuGet is in the path" do
14
- @nugetinstall.command.should == "NuGet.exe"
15
- end
16
- end
17
-
18
- it "generates the correct command-line parameters" do
19
- @nugetinstall.package = "Hircine"
20
- @nugetinstall.sources = "source1", "source2"
21
- @nugetinstall.version = "0.1.1-pre"
22
- @nugetinstall.no_cache = false
23
- @nugetinstall.prerelease = true
24
- @nugetinstall.exclude_version = true
25
- @nugetinstall.output_directory = "customdir"
26
-
27
- params = @nugetinstall.generate_params
28
- params.should include("install")
29
- params.should include(@nugetinstall.package)
30
- params.should include("-Version 0.1.1-pre")
31
- params.should include("-Source \"source1;source2\"")
32
- params.should include("-OutputDirectory customdir")
33
- params.should include("-ExcludeVersion")
34
- params.should include("-Prerelease")
35
- params.should_not include("-NoCache")
36
-
37
- @nugetinstall.no_cache = true
38
- params = @nugetinstall.generate_params
39
- params.should include("-NoCache")
40
- end
41
-
42
- it "fails if no package is specified" do
43
- @nugetinstall.extend(FailPatch)
44
- @nugetinstall.generate_params
45
- @strio.string.should include('A NuGet package must be specified.')
46
- end
1
+ require 'spec_helper'
2
+ require 'albacore/nugetinstall'
3
+
4
+ describe NuGetInstall do
5
+ before :each do
6
+ @nugetinstall = NuGetInstall.new
7
+ @strio = StringIO.new
8
+ @nugetinstall.log_device = @strio
9
+ @nugetinstall.log_level = :diagnostic
10
+ end
11
+
12
+ context "when no path to NuGet is specified" do
13
+ it "assumes NuGet is in the path" do
14
+ @nugetinstall.command.should == "NuGet.exe"
15
+ end
16
+ end
17
+
18
+ it "generates the correct command-line parameters" do
19
+ @nugetinstall.package = "Hircine"
20
+ @nugetinstall.sources = "source1", "source2"
21
+ @nugetinstall.version = "0.1.1-pre"
22
+ @nugetinstall.no_cache = false
23
+ @nugetinstall.prerelease = true
24
+ @nugetinstall.exclude_version = true
25
+ @nugetinstall.output_directory = "customdir"
26
+
27
+ params = @nugetinstall.generate_params
28
+ params.should include("install")
29
+ params.should include(@nugetinstall.package)
30
+ params.should include("-Version 0.1.1-pre")
31
+ params.should include("-Source \"source1;source2\"")
32
+ params.should include("-OutputDirectory customdir")
33
+ params.should include("-ExcludeVersion")
34
+ params.should include("-Prerelease")
35
+ params.should_not include("-NoCache")
36
+
37
+ @nugetinstall.no_cache = true
38
+ params = @nugetinstall.generate_params
39
+ params.should include("-NoCache")
40
+ end
41
+
42
+ it "fails if no package is specified" do
43
+ @nugetinstall.extend(FailPatch)
44
+ @nugetinstall.generate_params
45
+ @strio.string.should include('A NuGet package must be specified.')
46
+ end
47
47
  end
@@ -35,6 +35,27 @@ describe Output, 'when having a from and to set' do
35
35
 
36
36
  File.exist?("#{OutputTestData.to}/test.txt").should be_true
37
37
  end
38
+
39
+ it "should not remove to directory content if keep to is set" do
40
+ FileUtils.mkdir(OutputTestData.to)
41
+ FileUtils.touch("#{OutputTestData.to}/existing.txt")
42
+ @o.file 'test.txt'
43
+ @o.keep_to
44
+
45
+ @o.execute
46
+
47
+ File.exist?("#{OutputTestData.to}/existing.txt").should be_true
48
+ end
49
+
50
+ it "should remove to directory if keep to is not set" do
51
+ FileUtils.mkdir(OutputTestData.to)
52
+ FileUtils.touch("#{OutputTestData.to}/existing.txt")
53
+ @o.file 'test.txt'
54
+
55
+ @o.execute
56
+
57
+ File.exist?("#{OutputTestData.to}/existing.txt").should be_false
58
+ end
38
59
  end
39
60
 
40
61
 
@@ -80,6 +101,15 @@ describe Output, 'when having a from and to set' do
80
101
  File.exist?("#{OutputTestData.to}/subdir/foo").should be_true
81
102
  File.exist?("#{OutputTestData.to}/subdir/foo/test.txt").should be_true
82
103
  end
104
+
105
+ it "should create nested directory if specified in to" do
106
+ @o.to "#{OutputTestData.to}/subdir/"
107
+ @o.dir 'subdir/.'
108
+ @o.execute
109
+
110
+ File.exist?("#{OutputTestData.to}/subdir/foo/test.txt").should be_true
111
+
112
+ end
83
113
  end
84
114
 
85
115