albacore 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +84 -81
- data/VERSION +1 -1
- data/install_dependencies.rb +10 -10
- data/lib/albacore.rb +10 -2
- data/lib/albacore/assemblyinfo.rb +100 -100
- data/lib/albacore/assemblyinfolanguages/csharpengine.rb +14 -0
- data/lib/albacore/assemblyinfolanguages/vbnetengine.rb +14 -0
- data/lib/albacore/docu.rb +39 -0
- data/lib/albacore/exec.rb +23 -0
- data/lib/albacore/expandtemplates.rb +73 -71
- data/lib/albacore/msbuild.rb +56 -61
- data/lib/albacore/mspectestrunner.rb +44 -42
- data/lib/albacore/nant.rb +39 -0
- data/lib/albacore/ncoverconsole.rb +68 -61
- data/lib/albacore/ncoverreport.rb +56 -55
- data/lib/albacore/ncoverreports/assemblyfilter.rb +7 -7
- data/lib/albacore/ncoverreports/branchcoverage.rb +7 -7
- data/lib/albacore/ncoverreports/classfilter.rb +5 -5
- data/lib/albacore/ncoverreports/codecoveragebase.rb +22 -22
- data/lib/albacore/ncoverreports/cyclomaticcomplexity.rb +19 -19
- data/lib/albacore/ncoverreports/documentfilter.rb +5 -5
- data/lib/albacore/ncoverreports/fullcoveragereport.rb +17 -17
- data/lib/albacore/ncoverreports/methodcoverage.rb +7 -7
- data/lib/albacore/ncoverreports/methodfilter.rb +5 -5
- data/lib/albacore/ncoverreports/namespacefilter.rb +5 -5
- data/lib/albacore/ncoverreports/reportfilterbase.rb +23 -23
- data/lib/albacore/ncoverreports/summaryreport.rb +18 -18
- data/lib/albacore/ncoverreports/symbolcoverage.rb +6 -7
- data/lib/albacore/ndepend.rb +35 -0
- data/lib/albacore/nunittestrunner.rb +36 -35
- data/lib/albacore/plink.rb +48 -0
- data/lib/albacore/sftp.rb +33 -31
- data/lib/albacore/sqlcmd.rb +54 -51
- data/lib/albacore/ssh.rb +35 -33
- data/lib/albacore/support/albacore_helper.rb +1 -4
- data/lib/albacore/support/attrmethods.rb +25 -0
- data/lib/albacore/support/failure.rb +17 -17
- data/lib/albacore/support/globalconfig.rb +6 -0
- data/lib/albacore/support/logging.rb +30 -28
- data/lib/albacore/support/runcommand.rb +41 -41
- data/lib/albacore/support/yamlconfig.rb +23 -27
- data/lib/albacore/unzip.rb +28 -0
- data/lib/albacore/xbuild.rb +54 -0
- data/lib/albacore/xunittestrunner.rb +40 -43
- data/lib/albacore/zipdirectory.rb +72 -63
- data/lib/rake/assemblyinfotask.rb +12 -11
- data/lib/rake/docutask.rb +17 -0
- data/lib/rake/exectask.rb +18 -0
- data/lib/rake/expandtemplatestask.rb +12 -11
- data/lib/rake/msbuildtask.rb +13 -12
- data/lib/rake/mspectask.rb +12 -11
- data/lib/rake/nanttask.rb +17 -0
- data/lib/rake/ncoverconsoletask.rb +12 -11
- data/lib/rake/ncoverreporttask.rb +12 -11
- data/lib/rake/ndependtask.rb +23 -0
- data/lib/rake/nunittask.rb +12 -11
- data/lib/rake/plinktask.rb +23 -0
- data/lib/rake/renametask.rb +15 -15
- data/lib/rake/sftptask.rb +11 -10
- data/lib/rake/sqlcmdtask.rb +13 -12
- data/lib/rake/sshtask.rb +11 -10
- data/lib/rake/support/albacoretask.rb +16 -15
- data/lib/rake/unziptask.rb +17 -0
- data/lib/rake/xbuildtask.rb +22 -0
- data/lib/rake/xunittask.rb +12 -11
- data/lib/rake/ziptask.rb +12 -11
- data/rakefile.rb +255 -204
- data/spec/assemblyinfo_spec.rb +426 -221
- data/spec/assemblyinfotask_spec.rb +21 -21
- data/spec/docu_spec.rb +70 -0
- data/spec/docutask_spec.rb +39 -0
- data/spec/exec_spec.rb +23 -0
- data/spec/exectask_spec.rb +31 -0
- data/spec/expandtemplates_spec.rb +149 -148
- data/spec/expandtemplatestask_spec.rb +21 -21
- data/spec/msbuild_spec.rb +150 -139
- data/spec/msbuildtask_spec.rb +21 -21
- data/spec/mspectask_spec.rb +21 -21
- data/spec/nant_spec.rb +101 -0
- data/spec/nanttask_spec.rb +31 -0
- data/spec/ncoverconsole_spec.rb +253 -221
- data/spec/ncoverconsoletask_spec.rb +21 -21
- data/spec/ncoverreport_spec.rb +538 -523
- data/spec/ncoverreporttask_spec.rb +21 -21
- data/spec/ndepend_spec.rb +49 -0
- data/spec/{commandtask_spec.rb → ndependtask_spec.rb} +10 -10
- data/spec/nunittask_spec.rb +21 -21
- data/spec/nunittestrunner_spec.rb +6 -6
- data/spec/patches/docu_patch.rb +13 -0
- data/spec/patches/system_patch.rb +18 -18
- data/spec/patches/tasklib_patch.rb +10 -10
- data/spec/plink_spec.rb +61 -0
- data/spec/plinktask_spec.rb +31 -0
- data/spec/renametask_spec.rb +21 -21
- data/spec/sftp_spec.rb +24 -24
- data/spec/sftptask_spec.rb +31 -31
- data/spec/sqlcmd_spec.rb +118 -120
- data/spec/sqlcmdtask_spec.rb +21 -21
- data/spec/ssh_spec.rb +36 -37
- data/spec/sshtask_spec.rb +29 -29
- data/spec/support/TestSolution/NDependProject.xml +315 -0
- data/spec/support/TestSolution/TestSolution.XUnitTests/Class1.cs +12 -12
- data/spec/support/TestSolution/TestSolution.XUnitTests/FailingTestFixture.cs +14 -0
- data/spec/support/TestSolution/TestSolution.XUnitTests/TestSolution.XUnitTests.csproj +1 -0
- data/spec/support/TestSolution/TestSolution.build +25 -0
- data/spec/support/assemblyinfotester.rb +40 -38
- data/spec/support/expandtemplatestestdata.rb +73 -73
- data/spec/support/msbuildtestdata.rb +28 -28
- data/spec/support/nanttestdata.rb +33 -0
- data/spec/support/ncoverconsoletestdata.rb +18 -0
- data/spec/support/ncoverreporttestdata.rb +24 -24
- data/spec/support/spec_helper.rb +2 -1
- data/spec/support/yamlconfig/msbuild.yml +3 -0
- data/spec/support/yamlconfig/yaml_autoconfig_test.yml +1 -0
- data/spec/support/ziptestdata.rb +11 -6
- data/spec/xunit_spec.rb +63 -0
- data/spec/xunittask_spec.rb +19 -19
- data/spec/yamlconfig_spec.rb +38 -52
- data/spec/zip_spec.rb +56 -11
- data/spec/ziptask_spec.rb +22 -22
- metadata +53 -8
- data/lib/albacore/command.rb +0 -23
- data/lib/rake/commandtask.rb +0 -16
- data/spec/command_spec.rb +0 -23
@@ -1,42 +1,44 @@
|
|
1
1
|
require 'albacore/assemblyinfo'
|
2
2
|
|
3
3
|
class AssemblyInfoTester < AssemblyInfo
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
def setup_assemblyinfo_file
|
23
|
-
@assemblyinfo_file = File.join(File.dirname(__FILE__), "AssemblyInfo", "AssemblyInfo.cs")
|
24
|
-
File.delete @assemblyinfo_file if File.exist? @assemblyinfo_file
|
25
|
-
end
|
26
|
-
|
27
|
-
def build_and_read_assemblyinfo_file(assemblyinfo)
|
28
|
-
assemblyinfo.output_file = @assemblyinfo_file
|
29
|
-
assemblyinfo.write
|
4
|
+
|
5
|
+
attr_accessor :assemblyinfo_file
|
6
|
+
|
7
|
+
def initialize(lang_engine = nil)
|
8
|
+
@version = "0.0.0.1"
|
9
|
+
@title = "some assembly title"
|
10
|
+
@description = "some assembly description goes here."
|
11
|
+
@copyright = "some copyright info goes here"
|
12
|
+
@com_visible = false
|
13
|
+
@com_guid = "dbabb27c-a536-4b5b-91f1-2226b6e3655c"
|
14
|
+
@company_name = "some company name"
|
15
|
+
@product_name = "my product, yo."
|
16
|
+
@file_version = "1.0.0.0"
|
17
|
+
@trademark = "some trademark info goes here"
|
18
|
+
end
|
19
|
+
|
20
|
+
def setup_assemblyinfo_file
|
21
|
+
@lang_engine = CSharpEngine.new unless check_lang_engine
|
30
22
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
23
|
+
@assemblyinfo_file = File.join(File.dirname(__FILE__), "AssemblyInfo", "AssemblyInfo.test")
|
24
|
+
File.delete @assemblyinfo_file if File.exist? @assemblyinfo_file
|
25
|
+
end
|
26
|
+
|
27
|
+
def build_and_read_assemblyinfo_file(assemblyinfo)
|
28
|
+
setup_assemblyinfo_file
|
29
|
+
|
30
|
+
assemblyinfo.output_file = @assemblyinfo_file
|
31
|
+
assemblyinfo.write
|
32
|
+
|
33
|
+
contents = ''
|
34
|
+
File.open(@assemblyinfo_file, "r") do |f|
|
35
|
+
contents = f.read
|
36
|
+
end
|
37
|
+
contents
|
38
|
+
end
|
39
|
+
|
40
|
+
def yaml_file
|
41
|
+
return File.join(File.dirname(__FILE__), "AssemblyInfo", "assemblyinfo.yml")
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
@@ -1,77 +1,77 @@
|
|
1
1
|
class ExpandTemplatesTestData
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
2
|
+
|
3
|
+
def initialize
|
4
|
+
@rootfolder = File.join(File.dirname(__FILE__), "expandtemplates")
|
5
|
+
@templatefolder = File.join(@rootfolder, "templates")
|
6
|
+
@workingfolder = File.join(@rootfolder, "working")
|
7
|
+
@outputfolder = File.join(@rootfolder, "output")
|
8
|
+
@datafilesfolder = File.join(@rootfolder, "datafiles")
|
9
|
+
create_working_folder
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_working_folder
|
13
|
+
Dir.mkdir(@workingfolder) unless File.exist?(@workingfolder)
|
14
|
+
end
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
16
|
+
def prep_sample_templates
|
17
|
+
FileUtils.rm(Dir.glob(File.join(@workingfolder, "*")))
|
18
|
+
sleep(1)
|
19
|
+
|
20
|
+
Dir.glob(File.join(@templatefolder, "*")){|f|
|
21
|
+
FileUtils.copy(f, @workingfolder)
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
def sample_template_file
|
26
|
+
File.join(@workingfolder, "sample.config")
|
27
|
+
end
|
28
|
+
|
29
|
+
def multipleinstance_template_file
|
30
|
+
File.join(@workingfolder, "multipleinstance.config")
|
31
|
+
end
|
32
|
+
|
33
|
+
def sample_output_file
|
34
|
+
File.join(@workingfolder, "this_is_an_output_file.config")
|
35
|
+
end
|
36
|
+
|
37
|
+
def multiplevalues_template_file
|
38
|
+
File.join(@workingfolder, "multiplevalues.config")
|
39
|
+
end
|
40
|
+
|
41
|
+
def multiplevalues_output_file
|
42
|
+
File.join(@workingfolder, "multiplevalues_output_file.config")
|
43
|
+
end
|
44
|
+
|
45
|
+
def sample_data_file
|
46
|
+
File.join(@datafilesfolder, "sample.yml")
|
47
|
+
end
|
48
|
+
|
49
|
+
def sample_data_file_with_include
|
50
|
+
File.join(@datafilesfolder, "sample_with_include.yml")
|
51
|
+
end
|
52
|
+
|
53
|
+
def template_specific_data_file_with_include
|
54
|
+
File.join(@datafilesfolder, "template_specific_data_file_with_include.yml")
|
55
|
+
end
|
56
|
+
|
57
|
+
def multiplevalues_data_file
|
58
|
+
File.join(@datafilesfolder, "multiplevalues.yml")
|
59
|
+
end
|
60
|
+
|
61
|
+
def multitemplate_data_file
|
62
|
+
File.join(@datafilesfolder, "multitemplate.yml")
|
63
|
+
end
|
64
|
+
|
65
|
+
def multitemplate_specificfile_data_file
|
66
|
+
File.join(@datafilesfolder, "multitemplate-specificfile.yml")
|
67
|
+
end
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
69
|
+
def read_file(file)
|
70
|
+
filedata = ''
|
71
|
+
File.open(file, "r") {|f|
|
72
|
+
filedata = f.read
|
73
|
+
}
|
74
|
+
filedata
|
75
|
+
end
|
76
|
+
|
77
77
|
end
|
@@ -1,32 +1,32 @@
|
|
1
1
|
require 'albacore/msbuild'
|
2
2
|
|
3
3
|
class MSBuildTestData
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
4
|
+
|
5
|
+
attr_accessor :msbuild_path, :solution_path, :config_mode, :output_path
|
6
|
+
|
7
|
+
def initialize(config_mode='Debug')
|
8
|
+
@solution_path = File.join(File.dirname(__FILE__), "../", "support", "TestSolution", "TestSolution.sln")
|
9
|
+
@msbuild_path = "C:\\Windows/Microsoft.NET/Framework/v3.5/MSBuild.exe"
|
10
|
+
@config_mode = config_mode
|
11
|
+
|
12
|
+
setup_output
|
13
|
+
end
|
14
|
+
|
15
|
+
def setup_output
|
16
|
+
@output_path = File.join(File.dirname(__FILE__), "../", "support", "TestSolution", "TestSolution", "bin", "#{@config_mode}", "TestSolution.dll")
|
17
|
+
File.delete @output_path if File.exist? @output_path
|
18
|
+
end
|
19
|
+
|
20
|
+
def msbuild(path_to_msbuild=nil)
|
21
|
+
@msbuild = MSBuild.new
|
22
|
+
|
23
|
+
if (path_to_msbuild)
|
24
|
+
@msbuild_path = path_to_msbuild
|
25
|
+
(@msbuild.path_to_command = path_to_msbuild)
|
26
|
+
end
|
27
|
+
|
28
|
+
@msbuild.extend(SystemPatch)
|
29
|
+
@msbuild
|
30
|
+
end
|
31
|
+
|
32
32
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'albacore/nant'
|
2
|
+
|
3
|
+
class NAntTestData
|
4
|
+
|
5
|
+
attr_accessor :nant_path, :build_file_path, :output_path
|
6
|
+
|
7
|
+
def initialize(config_mode='Debug',version='0.0.1')
|
8
|
+
@config_mode = config_mode
|
9
|
+
@version = version
|
10
|
+
|
11
|
+
@nant_path = File.join(File.dirname(__FILE__), "Tools", "NAnt-0.85", "bin", "NAnt.exe")
|
12
|
+
@build_file_path = File.join(File.dirname(__FILE__), "TestSolution", "TestSolution.build")
|
13
|
+
setup_output
|
14
|
+
end
|
15
|
+
|
16
|
+
def setup_output
|
17
|
+
@output_root = File.join(File.dirname(__FILE__), "TestSolution", "out")
|
18
|
+
@output_path = File.join(@output_root, "#{@version}", "#{@config_mode}")
|
19
|
+
clean_output
|
20
|
+
end
|
21
|
+
|
22
|
+
def clean_output
|
23
|
+
FileUtils.rm_rf @output_root
|
24
|
+
end
|
25
|
+
|
26
|
+
def nant
|
27
|
+
@nant = NAnt.new
|
28
|
+
|
29
|
+
@nant.extend(SystemPatch)
|
30
|
+
@nant
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class NCoverConsoleTestData
|
2
|
+
attr_accessor :ncoverpath, :nunitpath, :xml_coverage_output, :html_coverage_output, :working_directory
|
3
|
+
attr_accessor :test_assembly, :failing_test_assembly, :mspecpath, :mspec_html_output, :mspec_test_assembly
|
4
|
+
|
5
|
+
def initialize
|
6
|
+
@ncoverpath = File.join(File.dirname(__FILE__), '..', 'support', 'Tools', 'NCover-v3.3', 'NCover.Console.exe')
|
7
|
+
@nunitpath = File.join(File.dirname(__FILE__), '..', 'support', 'Tools', 'NUnit-v2.5', 'nunit-console-x86.exe')
|
8
|
+
@xml_coverage_output = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'nunit', 'test-coverage.xml')
|
9
|
+
@html_coverage_output = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'nunit', 'html', 'test-coverage.html')
|
10
|
+
@working_directory = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'nunit')
|
11
|
+
@test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'nunit', 'assemblies', 'TestSolution.Tests.dll')
|
12
|
+
@failing_test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'nunit', 'failing_assemblies', 'TestSolution.FailingTests.dll')
|
13
|
+
|
14
|
+
@mspecpath = File.join(File.dirname(__FILE__), '..', 'support', 'Tools', 'Machine.Specification-v0.2', 'Machine.Specifications.ConsoleRunner.exe')
|
15
|
+
@mspec_html_output = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'mspec', 'html')
|
16
|
+
@mspec_test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), '..', 'support', 'CodeCoverage', 'mspec', 'assemblies', 'TestSolution.MSpecTests.dll')
|
17
|
+
end
|
18
|
+
end
|
@@ -1,26 +1,26 @@
|
|
1
1
|
class NCoverReportTestData
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
2
|
+
@filedir = File.dirname(__FILE__)
|
3
|
+
@output_folder = File.expand_path(File.join(@filedir, "CodeCoverage", "report", "output"))
|
4
|
+
|
5
|
+
def self.path_to_command
|
6
|
+
File.expand_path(File.join(@filedir, "Tools", "NCover-v3.3", "NCover.Reporting.exe"))
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.coverage_file
|
10
|
+
File.expand_path(File.join(@filedir, "CodeCoverage", "report", "coverage.xml"))
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.output_folder
|
14
|
+
@output_folder
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.clean_output_folder
|
18
|
+
FileUtils.rmtree(@output_folder)
|
19
|
+
Dir.mkdir(@output_folder) unless File.exist?(@output_folder)
|
20
|
+
sleep(3) # this is a hack to work around the slow hard drive in my laptop, which caused failing tests w/ write-through-cache.
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.summary_output_file
|
24
|
+
File.join(NCoverReportTestData.output_folder, "summary.html")
|
25
|
+
end
|
26
26
|
end
|
data/spec/support/spec_helper.rb
CHANGED
@@ -7,11 +7,12 @@ $: << File.join(@root_dir, "spec/support")
|
|
7
7
|
|
8
8
|
require 'rake/tasklib'
|
9
9
|
require 'lib/rake/support/albacoretask.rb'
|
10
|
+
require 'lib/albacore/support/globalconfig.rb'
|
10
11
|
require 'not_a_mock'
|
11
12
|
require 'system_patch'
|
12
13
|
require 'tasklib_patch'
|
13
14
|
|
14
15
|
Spec::Runner.configure do |config|
|
15
|
-
|
16
|
+
config.mock_with NotAMock::RspecMockFrameworkAdapter
|
16
17
|
end
|
17
18
|
|
@@ -0,0 +1 @@
|
|
1
|
+
some_attribute: "this value was loaded from a folder, specified by Albacore::yaml_config_folder"
|
data/spec/support/ziptestdata.rb
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
class ZipTestData
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
|
3
|
+
@@folder = File.expand_path(File.join(File.dirname(__FILE__), 'zip'))
|
4
|
+
@@output_folder = File.expand_path(File.join(File.dirname(__FILE__), 'zip_output'))
|
5
|
+
|
6
|
+
def self.folder
|
7
|
+
@@folder
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.output_folder
|
11
|
+
@@output_folder
|
12
|
+
end
|
8
13
|
end
|
data/spec/xunit_spec.rb
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
|
2
|
+
require 'albacore/xunittestrunner'
|
3
|
+
|
4
|
+
@@xunitpath = File.join(File.dirname(__FILE__), 'support', 'Tools', 'XUnit-v1.5', 'xunit.console.exe')
|
5
|
+
@@test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'CodeCoverage', 'xunit', 'assemblies', 'TestSolution.XUnitTests.dll')
|
6
|
+
@@output_option = "/out=xunit.results.html"
|
7
|
+
|
8
|
+
describe XUnitTestRunner, "the command parameters for an xunit runner" do
|
9
|
+
before :all do
|
10
|
+
xunit = XUnitTestRunner.new(@@xunitpath)
|
11
|
+
xunit.assembly = @@test_assembly
|
12
|
+
xunit.options @@output_option
|
13
|
+
|
14
|
+
@command_parameters = xunit.get_command_parameters
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should not include the path to the command" do
|
18
|
+
@command_parameters.should_not include(@@xunitpath)
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should include the list of assemblies" do
|
22
|
+
@command_parameters.should include("\"#{@@test_assembly}\"")
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should include the list of options" do
|
26
|
+
@command_parameters.should include(@@output_option)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe XUnitTestRunner, "the command line string for an xunit runner" do
|
31
|
+
before :all do
|
32
|
+
xunit = XUnitTestRunner.new(@@xunitpath)
|
33
|
+
xunit.assembly = @@test_assembly
|
34
|
+
xunit.options @@output_option
|
35
|
+
|
36
|
+
@command_line = xunit.get_command_line
|
37
|
+
@command_parameters = xunit.get_command_parameters.join(" ")
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should start with the path to the command" do
|
41
|
+
@command_line.split(" ").first.should == @@xunitpath
|
42
|
+
end
|
43
|
+
|
44
|
+
it "should include the command parameters" do
|
45
|
+
@command_line.should include(@command_parameters)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
|
50
|
+
describe XUnitTestRunner, "when configured correctly" do
|
51
|
+
before :all do
|
52
|
+
xunit = XUnitTestRunner.new(@@xunitpath)
|
53
|
+
xunit.assembly = @@test_assembly
|
54
|
+
xunit.options '/noshadow'
|
55
|
+
|
56
|
+
xunit.execute
|
57
|
+
@failed = xunit.failed
|
58
|
+
end
|
59
|
+
|
60
|
+
it "should execute" do
|
61
|
+
@failed.should be_false
|
62
|
+
end
|
63
|
+
end
|