albacore 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. data/Gemfile +7 -7
  2. data/README.markdown +0 -33
  3. data/VERSION +1 -1
  4. metadata +84 -91
  5. data/spec/albacoremodel_spec.rb +0 -53
  6. data/spec/assemblyinfo_spec.rb +0 -541
  7. data/spec/attrmethods_spec.rb +0 -136
  8. data/spec/config_spec.rb +0 -34
  9. data/spec/createtask_spec.rb +0 -236
  10. data/spec/csc_spec.rb +0 -253
  11. data/spec/docu_spec.rb +0 -109
  12. data/spec/exec_spec.rb +0 -45
  13. data/spec/fluentmigratorrunner_spec.rb +0 -254
  14. data/spec/msbuild_spec.rb +0 -215
  15. data/spec/mspec_spec.rb +0 -28
  16. data/spec/mstesttestrunner_spec.rb +0 -142
  17. data/spec/nant_spec.rb +0 -110
  18. data/spec/nchurn_spec.rb +0 -75
  19. data/spec/ncoverconsole_spec.rb +0 -353
  20. data/spec/ncoverreport_spec.rb +0 -619
  21. data/spec/ndepend_spec.rb +0 -72
  22. data/spec/nunittestrunner_spec.rb +0 -122
  23. data/spec/nuspec_spec.rb +0 -78
  24. data/spec/output_spec.rb +0 -117
  25. data/spec/patches/docu_patch.rb +0 -13
  26. data/spec/patches/fail_patch.rb +0 -9
  27. data/spec/patches/system_patch.rb +0 -20
  28. data/spec/plink_spec.rb +0 -62
  29. data/spec/runcommand_spec.rb +0 -94
  30. data/spec/spec_helper.rb +0 -17
  31. data/spec/specflowreport_spec.rb +0 -146
  32. data/spec/sqlcmd_spec.rb +0 -334
  33. data/spec/support/assemblyinfotester.rb +0 -51
  34. data/spec/support/ironruby_validator.rb +0 -26
  35. data/spec/support/msbuildtestdata.rb +0 -32
  36. data/spec/support/nanttestdata.rb +0 -33
  37. data/spec/support/ncoverconsoletestdata.rb +0 -20
  38. data/spec/support/ncoverreporttestdata.rb +0 -26
  39. data/spec/support/nokogiri_validator.rb +0 -15
  40. data/spec/support/outputtestdata.rb +0 -13
  41. data/spec/support/ziptestdata.rb +0 -13
  42. data/spec/unzip_spec.rb +0 -15
  43. data/spec/xbuild_spec.rb +0 -15
  44. data/spec/xunit_spec.rb +0 -168
  45. data/spec/yamlconfig_spec.rb +0 -49
  46. data/spec/zip_spec.rb +0 -104
@@ -1,72 +0,0 @@
1
- require 'spec_helper'
2
- require 'albacore/ndepend'
3
- require 'albacore/msbuild'
4
-
5
- describe "when executing Ndepend console" do
6
- before :all do
7
- @msbuild = MSBuild.new
8
- @msbuild.properties = {:configuration => :Debug}
9
- @msbuild.targets = [:Clean, :Build]
10
- @msbuild.solution = "spec/support/TestSolution/TestSolution.sln"
11
- @msbuild.execute
12
- end
13
- before :each do
14
- @ndepend = NDepend.new
15
- @ndepend.log_device = StringIO.new
16
- @ndepend.project_file = "spec/support/TestSolution/NDependProject.xml"
17
- @ndepend.command = "spec/support/tools/Ndepend-v2.12/NDepend.Console.exe"
18
-
19
- @logger = StringIO.new
20
- @ndepend.log_device = @logger
21
- @log_data = @logger.string
22
- @ndepend.log_level = :verbose
23
-
24
-
25
- end
26
- it "should execute NdependConsole.exe"do
27
- @ndepend.execute
28
-
29
- @log_data.should include("NDepend.Console.exe" )
30
- end
31
-
32
- it "should include the Ndepend project file" do
33
- @ndepend.execute
34
- @log_data.should include("NDependProject.xml")
35
- end
36
-
37
- it "should fail when the project file is not given" do
38
- @ndepend.project_file = nil
39
- @ndepend.extend(FailPatch)
40
- @ndepend.execute
41
- $task_failed.should be_true
42
- end
43
-
44
- it "should accept other parameters" do
45
- expected_params = "/ViewReport /Silent /Help"
46
- @ndepend.parameters expected_params
47
- @ndepend.extend(FailPatch)
48
- @ndepend.execute
49
- @log_data.should include(expected_params)
50
- end
51
-
52
- it "should order command line properly by including ndepend project file first" do
53
- expected_params = "/Help"
54
- @ndepend.parameters expected_params
55
- @ndepend.extend(FailPatch)
56
- @ndepend.execute
57
- @log_data.should =~ /.*NDepend.Console.exe.*NDependProject.xml.*Help.*/
58
- end
59
- end
60
-
61
- describe NDepend, "when providing configuration" do
62
- let :ndepend do
63
- Albacore.configure do |config|
64
- config.ndepend.command = "configured"
65
- end
66
- ndepend = NDepend.new
67
- end
68
-
69
- it "should use the configured values" do
70
- ndepend.command.should == "configured"
71
- end
72
- end
@@ -1,122 +0,0 @@
1
- require 'spec_helper'
2
- require 'albacore/nunittestrunner'
3
-
4
- shared_examples_for "nunit paths" do
5
- before :all do
6
- @nunitpath = File.join(File.dirname(__FILE__), 'support', 'Tools', 'NUnit-v2.5', 'nunit-console-x86.exe')
7
- @test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'CodeCoverage', 'nunit', 'assemblies', 'TestSolution.Tests.dll')
8
- @failing_test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'CodeCoverage', 'nunit', 'failing_assemblies', 'TestSolution.FailingTests.dll')
9
- @output_option = "/out=nunit.results.html"
10
- end
11
- end
12
-
13
- describe NUnitTestRunner, "the command parameters for an nunit runner" do
14
- it_should_behave_like "nunit paths"
15
-
16
- before :all do
17
- nunit = NUnitTestRunner.new(@nunitpath)
18
- nunit.assemblies @test_assembly, @failing_test_assembly
19
- nunit.options @output_option
20
-
21
- @command_parameters = nunit.get_command_parameters
22
- end
23
-
24
- it "should not include the path to the command" do
25
- @command_parameters.should_not include(@nunitpath)
26
- end
27
-
28
- it "should include the list of assemblies" do
29
- @command_parameters.should include("\"#{@test_assembly}\" \"#{@failing_test_assembly}\"")
30
- end
31
-
32
- it "should include the list of options" do
33
- @command_parameters.should include(@output_option)
34
- end
35
- end
36
-
37
- describe NUnitTestRunner, "the command line string for an nunit runner" do
38
- it_should_behave_like "nunit paths"
39
-
40
- before :all do
41
- nunit = NUnitTestRunner.new(@nunitpath)
42
- nunit.assemblies @test_assembly
43
- nunit.options @output_option
44
-
45
- @command_line = nunit.get_command_line
46
- @command_parameters = nunit.get_command_parameters.join(" ")
47
- end
48
-
49
- it "should start with the path to the command" do
50
- @command_line.split(" ").first.should == @nunitpath
51
- end
52
-
53
- it "should include the command parameters" do
54
- @command_line.should include(@command_parameters)
55
- end
56
- end
57
-
58
-
59
- describe NUnitTestRunner, "when configured correctly" do
60
- it_should_behave_like "nunit paths"
61
-
62
- before :all do
63
- nunit = NUnitTestRunner.new(@nunitpath)
64
- nunit.extend(FailPatch)
65
- nunit.assemblies @test_assembly
66
- nunit.options '/noshadow'
67
-
68
- nunit.execute
69
- end
70
-
71
- it "should execute" do
72
- $task_failed.should be_false
73
- end
74
- end
75
-
76
- describe NUnitTestRunner, "when using the configuration command and not providing a command in the intializer" do
77
- it_should_behave_like "nunit paths"
78
-
79
- before :all do
80
- Albacore.configure do |config|
81
- config.nunit.command = "configured command"
82
- end
83
- @nunit = NUnitTestRunner.new
84
- end
85
-
86
- it "should use the configuration command" do
87
- @nunit.command.should == "configured command"
88
- end
89
- end
90
-
91
- describe NUnitTestRunner, "when the command has been set through configuration and providing a command in the intializer" do
92
- it_should_behave_like "nunit paths"
93
-
94
- before :all do
95
- Albacore.configure do |config|
96
- config.nunit.command = "configured command"
97
- end
98
- @nunit = NUnitTestRunner.new("initializer command")
99
- end
100
-
101
- it "should use the initializer command" do
102
- @nunit.command.should == "initializer command"
103
- end
104
- end
105
-
106
- describe NUnitTestRunner, "when configuration has been provided" do
107
- before :all do
108
- Albacore.configure do |config|
109
- config.nunit do |nunit|
110
- nunit.assemblies = ["foo.dll", "bar.dll"]
111
- nunit.options = ["/noshadow"]
112
- end
113
- end
114
-
115
- @nunit = NUnitTestRunner.new
116
- end
117
-
118
- it "should use the provided configuration" do
119
- @nunit.assemblies.should == ["foo.dll", "bar.dll"]
120
- @nunit.options.should == ["/noshadow"]
121
- end
122
- end
@@ -1,78 +0,0 @@
1
- require 'fileutils'
2
- require 'spec_helper.rb'
3
- require 'albacore/nuspec.rb'
4
-
5
- if IS_IRONRUBY
6
- require 'support\ironruby_validator'
7
- else
8
- require 'support\nokogiri_validator'
9
- end
10
-
11
- describe Nuspec do
12
- let(:working_dir) do
13
- wd = File.expand_path(File.join(File.dirname(__FILE__), 'support/nuspec/output'))
14
- FileUtils.mkdir(wd) unless File.exist?(wd)
15
- wd
16
- end
17
- let(:nuspec_output) { File.join(working_dir, 'nuspec_test.nuspec') }
18
- let(:schema_file) { File.expand_path(File.join(working_dir, '../', 'nuspec.xsd')) }
19
-
20
- describe 'when creating a file with minimum requirements' do
21
- let(:nuspec) do
22
- nuspec = Nuspec.new
23
- nuspec.id="nuspec_test"
24
- nuspec.output_file = "nuspec_test.nuspec"
25
- nuspec.version = "1.2.3"
26
- nuspec.authors = "Author Name"
27
- nuspec.description = "test_xml_document"
28
- nuspec.working_directory = working_dir
29
- nuspec
30
- end
31
-
32
- before do
33
- nuspec.execute
34
- end
35
-
36
- it "should produce the nuspec xml" do
37
- File.exist?(nuspec_output).should be_true
38
- end
39
-
40
- it "should produce a valid xml file" do
41
- is_valid = XmlValidator.validate(nuspec_output, schema_file)
42
- is_valid.should be_true
43
- end
44
- end
45
-
46
- describe "file targets" do
47
- let(:dll) { File.expand_path(File.join(working_dir, '../', 'somedll.dll')) }
48
-
49
- let(:nuspec) do
50
- nuspec = Nuspec.new
51
- nuspec.id="nuspec_test"
52
- nuspec.output_file = "nuspec_test.nuspec"
53
- nuspec.title = "Title"
54
- nuspec.version = "1.2.3"
55
- nuspec.authors = "Author Name"
56
- nuspec.description = "test_xml_document"
57
- nuspec.working_directory = working_dir
58
- nuspec.file(dll, "lib")
59
- nuspec
60
- end
61
-
62
- before do
63
- nuspec.execute
64
- File.open(nuspec_output, "r") do |f|
65
- @filedata = f.read
66
- end
67
- end
68
-
69
- it "should produce a valid nuspec file" do
70
- is_valid = XmlValidator.validate(nuspec_output, schema_file)
71
- is_valid.should be_true
72
- end
73
-
74
- it "should contain the file and it's target" do
75
- @filedata.should include("<file src='C:/dev/albacore/spec/support/nuspec/somedll.dll' target='lib'/>")
76
- end
77
- end
78
- end
@@ -1,117 +0,0 @@
1
- require 'spec_helper'
2
- require 'outputtestdata'
3
- describe Output, 'when having a from and to set' do
4
-
5
- before :each do
6
- FileUtils.mkdir(OutputTestData.from) unless File.exists? OutputTestData.from
7
-
8
- @o = Output.new
9
- @o.from OutputTestData.from
10
- @o.to OutputTestData.to
11
-
12
- end
13
- after :each do
14
- FileUtils.rm_rf OutputTestData.to if File.exists? OutputTestData.to
15
- FileUtils.rm_rf OutputTestData.from if File.exists? OutputTestData.from
16
- end
17
-
18
-
19
- describe 'and when outputting files' do
20
- before :each do
21
- File.open("#{OutputTestData.from}/test.txt", "w"){|f| f.write "test" }
22
- end
23
-
24
- it "should not output a file if not specified so" do
25
- @o.execute
26
-
27
- File.exist?("#{OutputTestData.to}/test.txt").should be_false
28
- end
29
-
30
- it "should output a file specified" do
31
- @o.file 'test.txt'
32
- @o.execute
33
-
34
- File.exist?("#{OutputTestData.to}/test.txt").should be_true
35
- end
36
- end
37
-
38
-
39
- describe 'and when outputting directories' do
40
- before :each do
41
- subdir = "#{OutputTestData.from}/subdir"
42
- FileUtils.mkdir(subdir) unless File.exists? subdir
43
- File.open("#{OutputTestData.from}/subdir/test.txt", "w"){|f| f.write "test_sub" }
44
- end
45
-
46
- it "should not output a directory if not specified so" do
47
- @o.execute
48
-
49
- File.exist?("#{OutputTestData.to}/subdir").should be_false
50
- end
51
-
52
- it "should output a directory and content if specified" do
53
- @o.dir 'subdir'
54
- @o.execute
55
-
56
- File.exist?("#{OutputTestData.to}/subdir").should be_true
57
- File.exist?("#{OutputTestData.to}/subdir/test.txt").should be_true
58
- end
59
- end
60
-
61
- describe 'and when outputting nested directories' do
62
- before :each do
63
- subdir = "#{OutputTestData.from}/subdir/foo"
64
- FileUtils.mkdir_p(subdir) unless File.exists? subdir
65
- File.open("#{OutputTestData.from}/subdir/foo/test.txt", "w"){|f| f.write "test_sub" }
66
- end
67
-
68
- it "should not output a directory if not specified so" do
69
- @o.execute
70
-
71
- File.exist?("#{OutputTestData.to}/subdir/foo").should be_false
72
- end
73
-
74
- it "should output a directory and content if specified" do
75
- @o.dir 'subdir'
76
- @o.execute
77
-
78
- File.exist?("#{OutputTestData.to}/subdir/foo").should be_true
79
- File.exist?("#{OutputTestData.to}/subdir/foo/test.txt").should be_true
80
- end
81
- end
82
-
83
-
84
- describe 'and when outputting files with renaming them at target' do
85
- before :each do
86
- subdir = "#{OutputTestData.from}/subdir/foo"
87
- FileUtils.mkdir_p(subdir) unless File.exists? subdir
88
- File.open("#{OutputTestData.from}/subdir/foo/test.txt", "w"){|f| f.write "test_sub" }
89
- end
90
-
91
- it "should rename and create entire path if nested deeply" do
92
- @o.file 'subdir/foo/test.txt', :as => 'subdir/foo/hello.txt'
93
- @o.execute
94
-
95
- File.exist?("#{OutputTestData.to}/subdir/foo").should be_true
96
- File.exist?("#{OutputTestData.to}/subdir/foo/hello.txt").should be_true
97
- File.exist?("#{OutputTestData.to}/subdir/foo/test.txt").should be_false
98
- end
99
- end
100
-
101
- describe 'and when using erb, should have templated output' do
102
- before :each do
103
- subdir = "#{OutputTestData.from}/subdir/foo"
104
- FileUtils.mkdir_p(subdir) unless File.exists? subdir
105
- File.open("#{OutputTestData.from}/subdir/foo/web.config.erb", "w"){|f| f.write "test_sub <%= my_value %>" }
106
- end
107
-
108
- it "should rename and create entire path if nested deeply" do
109
- @o.erb 'subdir/foo/web.config.erb', :as => 'subdir/foo/web.config', :locals => { :my_value => 'hello' }
110
- @o.execute
111
-
112
- File.exist?("#{OutputTestData.to}/subdir/foo").should be_true
113
- File.exist?("#{OutputTestData.to}/subdir/foo/web.config").should be_true
114
- File.read("#{OutputTestData.to}/subdir/foo/web.config").should == "test_sub hello"
115
- end
116
- end
117
- end
@@ -1,13 +0,0 @@
1
- class Docu
2
- attr_accessor :command_result, :command_parameters, :failed, :failure_message
3
-
4
- def run_command(command_name="Command Line", command_parameters="")
5
- @command_parameters = command_parameters
6
- @command_result || false
7
- end
8
-
9
- def fail_with_message(msg)
10
- @failed = true
11
- @failure_message = msg
12
- end
13
- end
@@ -1,9 +0,0 @@
1
- module FailPatch
2
- def self.extended(obj)
3
- $task_failed = false
4
- end
5
-
6
- def fail(*args)
7
- $task_failed = true
8
- end
9
- end
@@ -1,20 +0,0 @@
1
- module SystemPatch
2
- attr_accessor :disable_system, :force_system_failure
3
-
4
- def initialize
5
- @disable_system = false
6
- @force_command_failure = false
7
- end
8
-
9
- def system_command
10
- @system_command
11
- end
12
-
13
- def system(cmd)
14
- @system_command = cmd
15
- result = true
16
- result = super(cmd) if !disable_system
17
- return false if @force_system_failure
18
- return result
19
- end
20
- end
@@ -1,62 +0,0 @@
1
- require 'spec_helper'
2
- require 'albacore/plink'
3
-
4
- describe PLink, 'when executing a command over plink' do
5
- before :each do
6
- @cmd = PLink.new
7
- @cmd.extend(SystemPatch)
8
- @cmd.extend(FailPatch)
9
- @cmd.command ="C:\\plink.exe"
10
- @cmd.host = "testhost"
11
-
12
- end
13
-
14
- it "should attempt to execute plink.exe" do
15
- @cmd.run
16
- @cmd.system_command.should include("plink.exe")
17
- end
18
-
19
- it "should attempt to connect to the test host on the default port (22)" do
20
- @cmd.run
21
- @cmd.system_command.should include("@testhost")
22
- @cmd.system_command.should include("-P 22")
23
- end
24
-
25
- it "should connect to the test host on a non default port 2200" do
26
- @cmd.port = 2200
27
- @cmd.run
28
- @cmd.system_command.should include("-P 2200")
29
- end
30
-
31
- it "should connect to the host with a username" do
32
- expected_user = "dummyuser"
33
- @cmd.user = expected_user
34
- @cmd.run
35
- @cmd.system_command.should include("#{expected_user}@")
36
- end
37
-
38
- it "should run remote commands in batch mode" do
39
- @cmd.run
40
- @cmd.system_command.should include("-batch")
41
- end
42
-
43
- it "should run commands in verbose mode" do
44
- @cmd.verbose = true
45
- @cmd.run
46
- @cmd.system_command.should include("-v")
47
- end
48
-
49
- it "should include the remote command" do
50
- expected_remote_exe = "C:\ThisIsTheRemoteExe.exe"
51
- @cmd.commands expected_remote_exe
52
- @cmd.run
53
- @cmd.system_command.should include(expected_remote_exe)
54
- end
55
-
56
- it "should include the remote command with parameters" do
57
- expected_remote_exe = "C:\\ThisIsTheRemoteExe.exe --help -o -p"
58
- @cmd.commands expected_remote_exe
59
- @cmd.run
60
- @cmd.system_command.should include(expected_remote_exe)
61
- end
62
- end