albacore 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.markdown +3 -0
- data/VERSION +1 -1
- data/lib/albacore/assemblyinfo.rb +1 -0
- data/lib/albacore/support/runcommand.rb +5 -3
- data/lib/albacore/xunittestrunner.rb +19 -13
- data/lib/rake/assemblyinfotask.rb +1 -1
- data/lib/rake/docutask.rb +1 -1
- data/lib/rake/exectask.rb +2 -2
- data/lib/rake/expandtemplatestask.rb +2 -2
- data/lib/rake/msbuildtask.rb +1 -1
- data/lib/rake/mspectask.rb +2 -2
- data/lib/rake/nanttask.rb +1 -1
- data/lib/rake/ncoverconsoletask.rb +1 -1
- data/lib/rake/ncoverreporttask.rb +2 -2
- data/lib/rake/ndependtask.rb +2 -2
- data/lib/rake/nunittask.rb +1 -1
- data/lib/rake/plinktask.rb +1 -1
- data/lib/rake/renametask.rb +1 -1
- data/lib/rake/sftptask.rb +2 -2
- data/lib/rake/sqlcmdtask.rb +2 -2
- data/lib/rake/sshtask.rb +1 -1
- data/lib/rake/support/createtask.rb +3 -2
- data/lib/rake/unziptask.rb +2 -2
- data/lib/rake/xbuildtask.rb +2 -2
- data/lib/rake/xunittask.rb +2 -2
- data/lib/rake/ziptask.rb +2 -2
- data/rakefile.rb +25 -22
- data/spec/assemblyinfo_spec.rb +83 -59
- data/spec/createtask_spec.rb +56 -6
- data/spec/runcommand_spec.rb +48 -0
- data/spec/spec.opts +1 -0
- data/spec/xunit_spec.rb +86 -6
- metadata +7 -3
data/README.markdown
CHANGED
@@ -86,5 +86,8 @@ Many thanks for contributions to albacore are due (in alphabetical order):
|
|
86
86
|
* [James Gregory](http://github.com/jagregory): the Docu task
|
87
87
|
* [Kevin Colyar](http://github.com/kevincolyar): Testing and updating of MSBuild to work with Cygwin
|
88
88
|
* [Mark Wilkins](http://github.com/markwilk): VB.NET Language Generator For The AssemblyInfo Task
|
89
|
+
* [Mike Nichols](http://github.com/mnichols): XUnit contributions, bug reports, etc
|
90
|
+
* [Nils Jonsson](http://github.com/njonsson): AssemblyInfo corrections, rakefile corrections
|
89
91
|
* [Sean Biefeld](http://github.com/seanbiefeld): MSpecTestRunner for NCoverConsole
|
90
92
|
* [Steven Harman](http://github.com/stevenharman): Finding some wicked bugs, patching nunit test runner, and the nant task
|
93
|
+
* [Panda Wood](http://github.com/pandawood): NCover Console options and wiki edits
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'albacore/support/failure'
|
2
|
+
require 'albacore/support/attrmethods.rb'
|
2
3
|
|
3
4
|
module RunCommand
|
4
5
|
extend AttrMethods
|
@@ -19,9 +20,10 @@ module RunCommand
|
|
19
20
|
return false unless valid_command_exists
|
20
21
|
end
|
21
22
|
|
22
|
-
|
23
|
+
combine_parameters = @parameters.collect
|
24
|
+
combine_parameters.push(command_parameters) unless command_parameters.nil?
|
23
25
|
|
24
|
-
command = "\"#{@path_to_command}\" #{
|
26
|
+
command = "\"#{@path_to_command}\" #{combine_parameters.join(' ')}"
|
25
27
|
@logger.debug "Executing #{command_name}: #{command}"
|
26
28
|
|
27
29
|
set_working_directory
|
@@ -47,4 +49,4 @@ module RunCommand
|
|
47
49
|
return if Dir.pwd == @original_directory
|
48
50
|
Dir.chdir(@original_directory)
|
49
51
|
end
|
50
|
-
end
|
52
|
+
end
|
@@ -5,8 +5,8 @@ class XUnitTestRunner
|
|
5
5
|
include RunCommand
|
6
6
|
include YAMLConfig
|
7
7
|
|
8
|
-
attr_accessor :html_output
|
9
|
-
attr_array :options
|
8
|
+
attr_accessor :html_output
|
9
|
+
attr_array :options,:assembly,:assemblies
|
10
10
|
|
11
11
|
def initialize(path_to_command='')
|
12
12
|
@path_to_command = path_to_command
|
@@ -24,22 +24,28 @@ class XUnitTestRunner
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def get_command_parameters
|
27
|
-
command_params = []
|
28
|
-
command_params << assembly.inspect unless @assembly.nil?
|
27
|
+
command_params = []
|
29
28
|
command_params << @options.join(" ") unless @options.nil?
|
30
29
|
command_params << build_html_output unless @html_output.nil?
|
31
30
|
command_params
|
32
31
|
end
|
33
32
|
|
34
|
-
def execute()
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
failure_message = 'XUnit Failed. See Build Log For Detail'
|
39
|
-
|
33
|
+
def execute()
|
34
|
+
@assemblies = [] unless !@assemblies.nil?
|
35
|
+
@assemblies << @assembly unless @assembly.nil?
|
36
|
+
fail_with_message 'At least one assembly is required for assemblies attr' if @assemblies.length==0
|
37
|
+
failure_message = 'XUnit Failed. See Build Log For Detail'
|
38
|
+
|
39
|
+
@assemblies.each do |assm|
|
40
|
+
command_params = get_command_parameters.collect{ |p| p % File.basename(assm) }
|
41
|
+
command_params.insert(0,assm)
|
42
|
+
result = run_command "XUnit", command_params.join(" ")
|
43
|
+
fail_with_message failure_message if !result
|
44
|
+
end
|
40
45
|
end
|
41
46
|
|
42
|
-
def build_html_output
|
43
|
-
|
47
|
+
def build_html_output
|
48
|
+
fail_with_message 'Directory is required for html_output' if !File.directory?(File.expand_path(@html_output))
|
49
|
+
"/html #{File.join(File.expand_path(@html_output),"%s.html")}"
|
44
50
|
end
|
45
|
-
end
|
51
|
+
end
|
data/lib/rake/docutask.rb
CHANGED
data/lib/rake/exectask.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
create_task :exec, Exec.new do |ex|
|
1
|
+
create_task :exec, Proc.new { Exec.new } do |ex|
|
2
2
|
ex.execute
|
3
|
-
end
|
3
|
+
end
|
@@ -1,3 +1,3 @@
|
|
1
|
-
create_task :expandtemplates, ExpandTemplates.new do |exp|
|
1
|
+
create_task :expandtemplates, Proc.new { ExpandTemplates.new } do |exp|
|
2
2
|
exp.expand
|
3
|
-
end
|
3
|
+
end
|
data/lib/rake/msbuildtask.rb
CHANGED
data/lib/rake/mspectask.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
create_task :mspec, MSpecTestRunner.new do |mspec|
|
1
|
+
create_task :mspec, Proc.new { MSpecTestRunner.new } do |mspec|
|
2
2
|
mspec.execute
|
3
|
-
end
|
3
|
+
end
|
data/lib/rake/nanttask.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
create_task :ncoverreport, NCoverReport.new do |ncoverreport|
|
1
|
+
create_task :ncoverreport, Proc.new { NCoverReport.new } do |ncoverreport|
|
2
2
|
ncoverreport.run
|
3
|
-
end
|
3
|
+
end
|
data/lib/rake/ndependtask.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
create_task :ndepend, NDepend.new do |cmd|
|
1
|
+
create_task :ndepend, Proc.new { NDepend.new } do |cmd|
|
2
2
|
cmd.run
|
3
|
-
end
|
3
|
+
end
|
data/lib/rake/nunittask.rb
CHANGED
data/lib/rake/plinktask.rb
CHANGED
data/lib/rake/renametask.rb
CHANGED
data/lib/rake/sftptask.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
create_task :sftp, Sftp.new do |cmd|
|
1
|
+
create_task :sftp, Proc.new { Sftp.new } do |cmd|
|
2
2
|
cmd.upload
|
3
|
-
end
|
3
|
+
end
|
data/lib/rake/sqlcmdtask.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
create_task :sqlcmd, SQLCmd.new do |cmd|
|
1
|
+
create_task :sqlcmd, Proc.new { SQLCmd.new } do |cmd|
|
2
2
|
cmd.run
|
3
|
-
end
|
3
|
+
end
|
data/lib/rake/sshtask.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
def create_task(taskname,
|
1
|
+
def create_task(taskname, task_object_proc, &execute_body)
|
2
2
|
taskclass = :"Albacore_TaskFor_#{taskname}"
|
3
3
|
taskmethod = taskname.to_s.downcase.to_sym
|
4
4
|
|
@@ -11,10 +11,11 @@ def create_task(taskname, task_object, &execute_body)
|
|
11
11
|
Albacore.class_eval do
|
12
12
|
const_set(taskclass, Class.new(Albacore::AlbacoreTask) do
|
13
13
|
define_method :execute do |name|
|
14
|
+
task_object = task_object_proc.call
|
14
15
|
task_object.load_config_by_task_name(name)
|
15
16
|
call_task_block(task_object)
|
16
17
|
execute_body.call(task_object) unless execute_body.nil?
|
17
18
|
end
|
18
19
|
end)
|
19
20
|
end
|
20
|
-
end
|
21
|
+
end
|
data/lib/rake/unziptask.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
create_task :unzip, Unzip.new do |zip|
|
1
|
+
create_task :unzip, Proc.new { Unzip.new } do |zip|
|
2
2
|
zip.unzip
|
3
|
-
end
|
3
|
+
end
|
data/lib/rake/xbuildtask.rb
CHANGED
data/lib/rake/xunittask.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
create_task :xunit, XUnitTestRunner.new do |x|
|
1
|
+
create_task :xunit, Proc.new { XUnitTestRunner.new } do |x|
|
2
2
|
x.execute
|
3
|
-
end
|
3
|
+
end
|
data/lib/rake/ziptask.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
create_task :zip, ZipDirectory.new do |z|
|
1
|
+
create_task :zip, Proc.new { ZipDirectory.new } do |z|
|
2
2
|
z.package
|
3
|
-
end
|
3
|
+
end
|
data/rakefile.rb
CHANGED
@@ -4,133 +4,136 @@ task :default => ['albacore:sample']
|
|
4
4
|
|
5
5
|
namespace :specs do
|
6
6
|
require 'spec/rake/spectask'
|
7
|
+
runtime_is_ironruby = (!defined?(IRONRUBY_VERSION).nil?)
|
7
8
|
|
8
9
|
@spec_opts = '--colour --format specdoc'
|
9
10
|
|
10
11
|
desc "Run functional specs for Albacore"
|
11
12
|
Spec::Rake::SpecTask.new :all do |t|
|
12
|
-
t.spec_files = 'spec/**/*_spec.rb'
|
13
|
+
t.spec_files = FileList['spec/**/*_spec.rb'].exclude{ |f|
|
14
|
+
f if runtime_is_ironruby && (f.include?("ssh") || f.include?("sftp"))
|
15
|
+
}
|
13
16
|
t.spec_opts << @spec_opts
|
14
17
|
end
|
15
18
|
|
16
19
|
desc "Run rake task specs for Albacore"
|
17
20
|
Spec::Rake::SpecTask.new :tasks do |t|
|
18
|
-
t.spec_files = 'spec/**/*task_spec.rb'
|
21
|
+
t.spec_files = FileList['spec/**/*task_spec.rb']
|
19
22
|
t.spec_opts << @spec_opts
|
20
23
|
end
|
21
24
|
|
22
25
|
desc "Assembly info functional specs"
|
23
26
|
Spec::Rake::SpecTask.new :assemblyinfo do |t|
|
24
|
-
t.spec_files = 'spec/assemblyinfo*_spec.rb'
|
27
|
+
t.spec_files = FileList['spec/assemblyinfo*_spec.rb']
|
25
28
|
t.spec_opts << @spec_opts
|
26
29
|
end
|
27
30
|
|
28
31
|
desc "MSBuild functional specs"
|
29
32
|
Spec::Rake::SpecTask.new :msbuild do |t|
|
30
|
-
t.spec_files = 'spec/msbuild*_spec.rb'
|
33
|
+
t.spec_files = FileList['spec/msbuild*_spec.rb']
|
31
34
|
t.spec_opts << @spec_opts
|
32
35
|
end
|
33
36
|
|
34
37
|
desc "SQLServer SQLCmd functional specs"
|
35
38
|
Spec::Rake::SpecTask.new :sqlcmd do |t|
|
36
|
-
t.spec_files = 'spec/sqlcmd*_spec.rb'
|
39
|
+
t.spec_files = FileList['spec/sqlcmd*_spec.rb']
|
37
40
|
t.spec_opts << @spec_opts
|
38
41
|
end
|
39
42
|
|
40
43
|
|
41
44
|
desc "Nant functional specs"
|
42
45
|
Spec::Rake::SpecTask.new :nant do |t|
|
43
|
-
t.spec_files = 'spec/nant*_spec.rb'
|
46
|
+
t.spec_files = FileList['spec/nant*_spec.rb']
|
44
47
|
t.spec_opts << @spec_opts
|
45
48
|
end
|
46
49
|
|
47
50
|
desc "NCover Console functional specs"
|
48
51
|
Spec::Rake::SpecTask.new :ncoverconsole do |t|
|
49
|
-
t.spec_files = 'spec/ncoverconsole*_spec.rb'
|
52
|
+
t.spec_files = FileList['spec/ncoverconsole*_spec.rb']
|
50
53
|
t.spec_opts << @spec_opts
|
51
54
|
end
|
52
55
|
|
53
56
|
desc "NCover Report functional specs"
|
54
57
|
Spec::Rake::SpecTask.new :ncoverreport do |t|
|
55
|
-
t.spec_files = 'spec/ncoverreport*_spec.rb'
|
58
|
+
t.spec_files = FileList['spec/ncoverreport*_spec.rb']
|
56
59
|
t.spec_opts << @spec_opts
|
57
60
|
end
|
58
61
|
|
59
62
|
desc "SSH functional specs"
|
60
63
|
Spec::Rake::SpecTask.new :ssh do |t|
|
61
|
-
t.spec_files = 'spec/ssh*_spec.rb'
|
64
|
+
t.spec_files = FileList['spec/ssh*_spec.rb']
|
62
65
|
t.spec_opts << @spec_opts
|
63
66
|
end
|
64
67
|
|
65
68
|
desc "Plink functional specs"
|
66
69
|
Spec::Rake::SpecTask.new :plink do |t|
|
67
|
-
t.spec_files = 'spec/plink*_spec.rb'
|
70
|
+
t.spec_files = FileList['spec/plink*_spec.rb']
|
68
71
|
t.spec_opts << @spec_opts
|
69
72
|
end
|
70
73
|
|
71
74
|
desc "Ndepend functional specs"
|
72
75
|
Spec::Rake::SpecTask.new :ndepend do |t|
|
73
|
-
t.spec_files = 'spec/ndepend*_spec.rb'
|
76
|
+
t.spec_files = FileList['spec/ndepend*_spec.rb']
|
74
77
|
t.spec_opts << @spec_opts
|
75
78
|
end
|
76
79
|
|
77
80
|
desc "SFTP functional specs"
|
78
81
|
Spec::Rake::SpecTask.new :sftp do |t|
|
79
|
-
t.spec_files = 'spec/sftp*_spec.rb'
|
82
|
+
t.spec_files = FileList['spec/sftp*_spec.rb']
|
80
83
|
t.spec_opts << @spec_opts
|
81
84
|
end
|
82
85
|
|
83
86
|
desc "Expand Templates functional specs"
|
84
87
|
Spec::Rake::SpecTask.new :templates do |t|
|
85
|
-
t.spec_files = 'spec/expandtemplates*_spec.rb'
|
88
|
+
t.spec_files = FileList['spec/expandtemplates*_spec.rb']
|
86
89
|
t.spec_opts << @spec_opts
|
87
90
|
end
|
88
91
|
|
89
92
|
desc "Zip functional specs"
|
90
93
|
Spec::Rake::SpecTask.new :zip do |t|
|
91
|
-
t.spec_files = 'spec/zip*_spec.rb'
|
94
|
+
t.spec_files = FileList['spec/zip*_spec.rb']
|
92
95
|
t.spec_opts << @spec_opts
|
93
96
|
end
|
94
97
|
|
95
98
|
desc "XUnit functional specs"
|
96
99
|
Spec::Rake::SpecTask.new :xunit do |t|
|
97
|
-
t.spec_files = 'spec/xunit*_spec.rb'
|
100
|
+
t.spec_files = FileList['spec/xunit*_spec.rb']
|
98
101
|
t.spec_opts << @spec_opts
|
99
102
|
end
|
100
103
|
|
101
104
|
desc "NUnit functional specs"
|
102
105
|
Spec::Rake::SpecTask.new :nunit do |t|
|
103
|
-
t.spec_files = 'spec/nunit*_spec.rb'
|
106
|
+
t.spec_files = FileList['spec/nunit*_spec.rb']
|
104
107
|
t.spec_opts << @spec_opts
|
105
108
|
end
|
106
109
|
|
107
110
|
desc "MSpec functional specs"
|
108
111
|
Spec::Rake::SpecTask.new :mspec do |t|
|
109
|
-
t.spec_files = 'spec/mspec*_spec.rb'
|
112
|
+
t.spec_files = FileList['spec/mspec*_spec.rb']
|
110
113
|
t.spec_opts << @spec_opts
|
111
114
|
end
|
112
115
|
|
113
116
|
desc "Exec functional specs"
|
114
117
|
Spec::Rake::SpecTask.new :exec do |t|
|
115
|
-
t.spec_files = 'spec/exec*_spec.rb'
|
118
|
+
t.spec_files = FileList['spec/exec*_spec.rb']
|
116
119
|
t.spec_opts << @spec_opts
|
117
120
|
end
|
118
121
|
|
119
122
|
desc "Rename functional specs"
|
120
123
|
Spec::Rake::SpecTask.new :rename do |t|
|
121
|
-
t.spec_files = 'spec/rename*_spec.rb'
|
124
|
+
t.spec_files = FileList['spec/rename*_spec.rb']
|
122
125
|
t.spec_opts << @spec_opts
|
123
126
|
end
|
124
127
|
|
125
128
|
desc "Docu functional specs"
|
126
129
|
Spec::Rake::SpecTask.new :docu do |t|
|
127
|
-
t.spec_files = 'spec/docu*_spec.rb'
|
130
|
+
t.spec_files = FileList['spec/docu*_spec.rb']
|
128
131
|
t.spec_opts << @spec_opts
|
129
132
|
end
|
130
133
|
|
131
134
|
desc "YAML Config functional specs"
|
132
135
|
Spec::Rake::SpecTask.new :yamlconfig do |t|
|
133
|
-
t.spec_files = 'spec/yaml*_spec.rb'
|
136
|
+
t.spec_files = FileList['spec/yaml*_spec.rb']
|
134
137
|
t.spec_opts << @spec_opts
|
135
138
|
end
|
136
139
|
end
|
@@ -262,7 +265,7 @@ namespace :jeweler do
|
|
262
265
|
gs.description = "Easily build your .NET solutions with Ruby and Rake, using this suite of Rake tasks."
|
263
266
|
gs.email = "derickbailey@gmail.com"
|
264
267
|
gs.homepage = "http://albacorebuild.net"
|
265
|
-
gs.authors = ["Derick Bailey", "Ben Hall"]
|
268
|
+
gs.authors = ["Derick Bailey", "Ben Hall", "etc"]
|
266
269
|
gs.has_rdoc = false
|
267
270
|
gs.files.exclude("albacore.gemspec", ".gitignore", "spec/support/Tools")
|
268
271
|
|
data/spec/assemblyinfo_spec.rb
CHANGED
@@ -68,11 +68,13 @@ describe AssemblyInfo, "when providing a custom namespace without specifiying th
|
|
68
68
|
|
69
69
|
asm.namespaces 'My.Name.Space'
|
70
70
|
|
71
|
+
# Generate the same file twice.
|
72
|
+
@tester.build_and_read_assemblyinfo_file asm
|
71
73
|
@filedata = @tester.build_and_read_assemblyinfo_file asm
|
72
74
|
end
|
73
75
|
|
74
76
|
it "should default to c# for the generated assemby info" do
|
75
|
-
@filedata.
|
77
|
+
@filedata.scan('using My.Name.Space;').length.should == 1
|
76
78
|
end
|
77
79
|
end
|
78
80
|
|
@@ -85,12 +87,14 @@ describe AssemblyInfo, "when providing custom namespaces and specifying C#" do
|
|
85
87
|
|
86
88
|
asm.namespaces 'My.Name.Space', 'Another.Namespace.GoesHere'
|
87
89
|
|
90
|
+
# Generate the same file twice.
|
91
|
+
@tester.build_and_read_assemblyinfo_file asm
|
88
92
|
@filedata = @tester.build_and_read_assemblyinfo_file asm
|
89
93
|
end
|
90
94
|
|
91
95
|
it "should write the namespaces into the using statements" do
|
92
|
-
@filedata.
|
93
|
-
@filedata.
|
96
|
+
@filedata.scan('using My.Name.Space;').length.should == 1
|
97
|
+
@filedata.scan('using Another.Namespace.GoesHere;').length.should == 1
|
94
98
|
end
|
95
99
|
end
|
96
100
|
|
@@ -103,12 +107,14 @@ describe AssemblyInfo, "when providing custom namespaces and specifying VB.NET"
|
|
103
107
|
|
104
108
|
asm.namespaces 'My.Name.Space', 'Another.Namespace.GoesHere'
|
105
109
|
|
110
|
+
# Generate the same file twice.
|
111
|
+
@tester.build_and_read_assemblyinfo_file asm
|
106
112
|
@filedata = @tester.build_and_read_assemblyinfo_file asm
|
107
113
|
end
|
108
114
|
|
109
115
|
it "should write the namespaces into the imports statements" do
|
110
|
-
@filedata.
|
111
|
-
@filedata.
|
116
|
+
@filedata.scan('Imports My.Name.Space').length.should == 1
|
117
|
+
@filedata.scan('Imports Another.Namespace.GoesHere').length.should == 1
|
112
118
|
end
|
113
119
|
end
|
114
120
|
|
@@ -119,12 +125,14 @@ describe AssemblyInfo, "when providing custom attributes without specifying a la
|
|
119
125
|
|
120
126
|
asm.custom_attributes :CustomAttribute => "custom attribute data", :AnotherAttribute => "more data here"
|
121
127
|
|
128
|
+
# Generate the same file twice.
|
129
|
+
@tester.build_and_read_assemblyinfo_file asm
|
122
130
|
@filedata = @tester.build_and_read_assemblyinfo_file asm
|
123
131
|
end
|
124
132
|
|
125
133
|
it "should write the custom attributes to the assembly info file" do
|
126
|
-
@filedata.
|
127
|
-
@filedata.
|
134
|
+
@filedata.scan('[assembly: CustomAttribute("custom attribute data")]').length.should == 1
|
135
|
+
@filedata.scan('[assembly: AnotherAttribute("more data here")]').length.should == 1
|
128
136
|
end
|
129
137
|
end
|
130
138
|
|
@@ -137,12 +145,14 @@ describe AssemblyInfo, "when providing custom attributes and specifying C#" do
|
|
137
145
|
|
138
146
|
asm.custom_attributes :CustomAttribute => "custom attribute data", :AnotherAttribute => "more data here"
|
139
147
|
|
148
|
+
# Generate the same file twice.
|
149
|
+
@tester.build_and_read_assemblyinfo_file asm
|
140
150
|
@filedata = @tester.build_and_read_assemblyinfo_file asm
|
141
151
|
end
|
142
152
|
|
143
153
|
it "should write the custom attributes to the assembly info file" do
|
144
|
-
@filedata.
|
145
|
-
@filedata.
|
154
|
+
@filedata.scan('[assembly: CustomAttribute("custom attribute data")]').length.should == 1
|
155
|
+
@filedata.scan('[assembly: AnotherAttribute("more data here")]').length.should == 1
|
146
156
|
end
|
147
157
|
end
|
148
158
|
|
@@ -155,12 +165,14 @@ describe AssemblyInfo, "when providing custom attributes and specifying VB.NET"
|
|
155
165
|
|
156
166
|
asm.custom_attributes :CustomAttribute => "custom attribute data", :AnotherAttribute => "more data here"
|
157
167
|
|
168
|
+
# Generate the same file twice.
|
169
|
+
@tester.build_and_read_assemblyinfo_file asm
|
158
170
|
@filedata = @tester.build_and_read_assemblyinfo_file asm
|
159
171
|
end
|
160
172
|
|
161
173
|
it "should write the custom attributes to the assembly info file" do
|
162
|
-
@filedata.
|
163
|
-
@filedata.
|
174
|
+
@filedata.scan('<assembly: CustomAttribute("custom attribute data")>').length.should == 1
|
175
|
+
@filedata.scan('<assembly: AnotherAttribute("more data here")>').length.should == 1
|
164
176
|
end
|
165
177
|
end
|
166
178
|
|
@@ -171,11 +183,13 @@ describe AssemblyInfo, "when specifying a custom attribute with no data" do
|
|
171
183
|
|
172
184
|
asm.custom_attributes :NoArgsAttribute => nil
|
173
185
|
|
186
|
+
# Generate the same file twice.
|
187
|
+
@tester.build_and_read_assemblyinfo_file asm
|
174
188
|
@filedata = @tester.build_and_read_assemblyinfo_file asm
|
175
189
|
end
|
176
190
|
|
177
191
|
it "should write the attribute with an empty argument list" do
|
178
|
-
@filedata.
|
192
|
+
@filedata.scan('[assembly: NoArgsAttribute()]').length.should == 1
|
179
193
|
end
|
180
194
|
end
|
181
195
|
|
@@ -186,11 +200,13 @@ describe AssemblyInfo, "when specifying an attribute with non-string data" do
|
|
186
200
|
|
187
201
|
asm.custom_attributes :NonStringAttribute => true
|
188
202
|
|
203
|
+
# Generate the same file twice.
|
204
|
+
@tester.build_and_read_assemblyinfo_file asm
|
189
205
|
@filedata = @tester.build_and_read_assemblyinfo_file asm
|
190
206
|
end
|
191
207
|
|
192
208
|
it "should write the attribute data without quotes" do
|
193
|
-
@filedata.
|
209
|
+
@filedata.scan('[assembly: NonStringAttribute(true)]').length.should == 1
|
194
210
|
end
|
195
211
|
end
|
196
212
|
|
@@ -210,52 +226,54 @@ describe AssemblyInfo, "when generating an assembly info file with the built in
|
|
210
226
|
asm.file_version = @tester.file_version
|
211
227
|
asm.trademark = @tester.trademark
|
212
228
|
|
229
|
+
# Generate the same file twice.
|
230
|
+
@tester.build_and_read_assemblyinfo_file asm
|
213
231
|
@filedata = @tester.build_and_read_assemblyinfo_file asm
|
214
232
|
end
|
215
233
|
|
216
234
|
it "should use the system.reflection namespace" do
|
217
|
-
@filedata.
|
235
|
+
@filedata.scan('using System.Reflection;').length.should == 1
|
218
236
|
end
|
219
237
|
|
220
238
|
it "should use the system.runtime.interopservices namespace" do
|
221
|
-
@filedata.
|
239
|
+
@filedata.scan('using System.Runtime.InteropServices;').length.should == 1
|
222
240
|
end
|
223
241
|
|
224
242
|
it "should contain the specified version information" do
|
225
|
-
@filedata.
|
243
|
+
@filedata.scan(%Q|[assembly: AssemblyVersion("#{@tester.version}")]|).length.should == 1
|
226
244
|
end
|
227
245
|
|
228
246
|
it "should contain the assembly title" do
|
229
|
-
@filedata.
|
247
|
+
@filedata.scan(%Q|[assembly: AssemblyTitle("#{@tester.title}")]|).length.should == 1
|
230
248
|
end
|
231
249
|
|
232
250
|
it "should contain the assembly description" do
|
233
|
-
@filedata.
|
251
|
+
@filedata.scan(%Q|[assembly: AssemblyDescription("#{@tester.description}")|).length.should == 1
|
234
252
|
end
|
235
253
|
|
236
254
|
it "should contain the copyright information" do
|
237
|
-
@filedata.
|
255
|
+
@filedata.scan(%Q|[assembly: AssemblyCopyright("#{@tester.copyright}")]|).length.should == 1
|
238
256
|
end
|
239
257
|
|
240
258
|
it "should contain the com visible information" do
|
241
|
-
@filedata.
|
242
|
-
@filedata.
|
259
|
+
@filedata.scan(%Q|[assembly: ComVisible(#{@tester.com_visible})]|).length.should == 1
|
260
|
+
@filedata.scan(%Q|[assembly: Guid("#{@tester.com_guid}")]|).length.should == 1
|
243
261
|
end
|
244
262
|
|
245
263
|
it "should contain the company name information" do
|
246
|
-
@filedata.
|
264
|
+
@filedata.scan(%Q|[assembly: AssemblyCompany("#{@tester.company_name}")]|).length.should == 1
|
247
265
|
end
|
248
266
|
|
249
267
|
it "should contain the product information" do
|
250
|
-
@filedata.
|
268
|
+
@filedata.scan(%Q|[assembly: AssemblyProduct("#{@tester.product_name}")]|).length.should == 1
|
251
269
|
end
|
252
270
|
|
253
271
|
it "should contain the file version information" do
|
254
|
-
@filedata.
|
272
|
+
@filedata.scan(%Q|[assembly: AssemblyFileVersion("#{@tester.file_version}")]|).length.should == 1
|
255
273
|
end
|
256
274
|
|
257
275
|
it "should contain the trademark information" do
|
258
|
-
@filedata.
|
276
|
+
@filedata.scan(%Q|[assembly: AssemblyTrademark("#{@tester.trademark}")]|).length.should == 1
|
259
277
|
end
|
260
278
|
end
|
261
279
|
|
@@ -277,52 +295,54 @@ describe AssemblyInfo, "when generating an assembly info file with the built in
|
|
277
295
|
asm.file_version = @tester.file_version
|
278
296
|
asm.trademark = @tester.trademark
|
279
297
|
|
298
|
+
# Generate the same file twice.
|
299
|
+
@tester.build_and_read_assemblyinfo_file asm
|
280
300
|
@filedata = @tester.build_and_read_assemblyinfo_file asm
|
281
301
|
end
|
282
302
|
|
283
303
|
it "should use the system.reflection namespace" do
|
284
|
-
@filedata.
|
304
|
+
@filedata.scan('using System.Reflection;').length.should == 1
|
285
305
|
end
|
286
306
|
|
287
307
|
it "should use the system.runtime.interopservices namespace" do
|
288
|
-
@filedata.
|
308
|
+
@filedata.scan('using System.Runtime.InteropServices;').length.should == 1
|
289
309
|
end
|
290
310
|
|
291
311
|
it "should contain the specified version information" do
|
292
|
-
@filedata.
|
312
|
+
@filedata.scan(%Q|[assembly: AssemblyVersion("#{@tester.version}")]|).length.should == 1
|
293
313
|
end
|
294
314
|
|
295
315
|
it "should contain the assembly title" do
|
296
|
-
@filedata.
|
316
|
+
@filedata.scan(%Q|[assembly: AssemblyTitle("#{@tester.title}")]|).length.should == 1
|
297
317
|
end
|
298
318
|
|
299
319
|
it "should contain the assembly description" do
|
300
|
-
@filedata.
|
320
|
+
@filedata.scan(%Q|[assembly: AssemblyDescription("#{@tester.description}")]|).length.should == 1
|
301
321
|
end
|
302
322
|
|
303
323
|
it "should contain the copyright information" do
|
304
|
-
@filedata.
|
324
|
+
@filedata.scan(%Q|[assembly: AssemblyCopyright("#{@tester.copyright}")]|).length.should == 1
|
305
325
|
end
|
306
326
|
|
307
327
|
it "should contain the com visible information" do
|
308
|
-
@filedata.
|
309
|
-
@filedata.
|
328
|
+
@filedata.scan(%Q|[assembly: ComVisible(#{@tester.com_visible})]|).length.should == 1
|
329
|
+
@filedata.scan(%Q|[assembly: Guid("#{@tester.com_guid}")]|).length.should == 1
|
310
330
|
end
|
311
331
|
|
312
332
|
it "should contain the company name information" do
|
313
|
-
@filedata.
|
333
|
+
@filedata.scan(%Q|[assembly: AssemblyCompany("#{@tester.company_name}")]|).length.should == 1
|
314
334
|
end
|
315
335
|
|
316
336
|
it "should contain the product information" do
|
317
|
-
@filedata.
|
337
|
+
@filedata.scan(%Q|[assembly: AssemblyProduct("#{@tester.product_name}")]|).length.should == 1
|
318
338
|
end
|
319
339
|
|
320
340
|
it "should contain the file version information" do
|
321
|
-
@filedata.
|
341
|
+
@filedata.scan(%Q|[assembly: AssemblyFileVersion("#{@tester.file_version}")]|).length.should == 1
|
322
342
|
end
|
323
343
|
|
324
344
|
it "should contain the trademark information" do
|
325
|
-
@filedata.
|
345
|
+
@filedata.scan(%Q|[assembly: AssemblyTrademark("#{@tester.trademark}")]|).length.should == 1
|
326
346
|
end
|
327
347
|
end
|
328
348
|
|
@@ -344,52 +364,54 @@ describe AssemblyInfo, "when generating an assembly info file with the built in
|
|
344
364
|
asm.file_version = @tester.file_version
|
345
365
|
asm.trademark = @tester.trademark
|
346
366
|
|
367
|
+
# Generate the same file twice.
|
368
|
+
@tester.build_and_read_assemblyinfo_file asm
|
347
369
|
@filedata = @tester.build_and_read_assemblyinfo_file asm
|
348
370
|
end
|
349
371
|
|
350
372
|
it "should use the system.reflection namespace" do
|
351
|
-
@filedata.
|
373
|
+
@filedata.scan('Imports System.Reflection').length.should == 1
|
352
374
|
end
|
353
375
|
|
354
376
|
it "should use the system.runtime.interopservices namespace" do
|
355
|
-
@filedata.
|
377
|
+
@filedata.scan('Imports System.Runtime.InteropServices').length.should == 1
|
356
378
|
end
|
357
379
|
|
358
380
|
it "should contain the specified version information" do
|
359
|
-
@filedata.
|
381
|
+
@filedata.scan(%Q|<assembly: AssemblyVersion("#{@tester.version}")>|).length.should == 1
|
360
382
|
end
|
361
383
|
|
362
384
|
it "should contain the assembly title" do
|
363
|
-
@filedata.
|
385
|
+
@filedata.scan(%Q|<assembly: AssemblyTitle("#{@tester.title}")>|).length.should == 1
|
364
386
|
end
|
365
387
|
|
366
388
|
it "should contain the assembly description" do
|
367
|
-
@filedata.
|
389
|
+
@filedata.scan(%Q|<assembly: AssemblyDescription("#{@tester.description}")>|).length.should == 1
|
368
390
|
end
|
369
391
|
|
370
392
|
it "should contain the copyright information" do
|
371
|
-
@filedata.
|
393
|
+
@filedata.scan(%Q|<assembly: AssemblyCopyright("#{@tester.copyright}")>|).length.should == 1
|
372
394
|
end
|
373
395
|
|
374
396
|
it "should contain the com visible information" do
|
375
|
-
@filedata.
|
376
|
-
@filedata.
|
397
|
+
@filedata.scan(%Q|<assembly: ComVisible(#{@tester.com_visible})>|).length.should == 1
|
398
|
+
@filedata.scan(%Q|<assembly: Guid("#{@tester.com_guid}")>|).length.should == 1
|
377
399
|
end
|
378
400
|
|
379
401
|
it "should contain the company name information" do
|
380
|
-
@filedata.
|
402
|
+
@filedata.scan(%Q|<assembly: AssemblyCompany("#{@tester.company_name}")>|).length.should == 1
|
381
403
|
end
|
382
404
|
|
383
405
|
it "should contain the product information" do
|
384
|
-
@filedata.
|
406
|
+
@filedata.scan(%Q|<assembly: AssemblyProduct("#{@tester.product_name}")>|).length.should == 1
|
385
407
|
end
|
386
408
|
|
387
409
|
it "should contain the file version information" do
|
388
|
-
@filedata.
|
410
|
+
@filedata.scan(%Q|<assembly: AssemblyFileVersion("#{@tester.file_version}")>|).length.should == 1
|
389
411
|
end
|
390
412
|
|
391
413
|
it "should contain the trademark information" do
|
392
|
-
@filedata.
|
414
|
+
@filedata.scan(%Q|<assembly: AssemblyTrademark("#{@tester.trademark}")>|).length.should == 1
|
393
415
|
end
|
394
416
|
end
|
395
417
|
|
@@ -398,44 +420,46 @@ describe AssemblyInfo, "when generating an assembly info file with no attributes
|
|
398
420
|
@tester = AssemblyInfoTester.new
|
399
421
|
asm = AssemblyInfo.new
|
400
422
|
|
423
|
+
# Generate the same file twice.
|
424
|
+
@tester.build_and_read_assemblyinfo_file asm
|
401
425
|
@filedata = @tester.build_and_read_assemblyinfo_file asm
|
402
426
|
end
|
403
427
|
|
404
428
|
it "should not contain the specified version information" do
|
405
|
-
@filedata.
|
429
|
+
@filedata.scan(%Q|[assembly: AssemblyVersion("#{@tester.version}")]|).should be_empty
|
406
430
|
end
|
407
431
|
|
408
432
|
it "should not contain the assembly title" do
|
409
|
-
@filedata.
|
433
|
+
@filedata.scan(%Q|[assembly: AssemblyTitle("#{@tester.title}")]|).should be_empty
|
410
434
|
end
|
411
435
|
|
412
436
|
it "should not contain the assembly description" do
|
413
|
-
@filedata.
|
437
|
+
@filedata.scan(%Q|[assembly: AssemblyDescription("#{@tester.description}")]|).should be_empty
|
414
438
|
end
|
415
439
|
|
416
440
|
it "should not contain the copyright information" do
|
417
|
-
@filedata.
|
441
|
+
@filedata.scan(%Q|[assembly: AssemblyCopyright("#{@tester.copyright}")]|).should be_empty
|
418
442
|
end
|
419
443
|
|
420
444
|
it "should not contain the com visible information" do
|
421
|
-
@filedata.
|
422
|
-
@filedata.
|
445
|
+
@filedata.scan(%Q|[assembly: ComVisible(#{@tester.com_visible})]|).should be_empty
|
446
|
+
@filedata.scan(%Q|[assembly: Guid("#{@tester.com_guid}")]|).should be_empty
|
423
447
|
end
|
424
448
|
|
425
449
|
it "should not contain the company name information" do
|
426
|
-
@filedata.
|
450
|
+
@filedata.scan(%Q|[assembly: AssemblyCompany("#{@tester.company_name}")]|).should be_empty
|
427
451
|
end
|
428
452
|
|
429
453
|
it "should not contain the product information" do
|
430
|
-
@filedata.
|
454
|
+
@filedata.scan(%Q|[assembly: AssemblyProduct("#{@tester.product_name}")]|).should be_empty
|
431
455
|
end
|
432
456
|
|
433
457
|
it "should not contain the file version information" do
|
434
|
-
@filedata.
|
458
|
+
@filedata.scan(%Q|[assembly: AssemblyFileVersion("#{@tester.file_version}")]|).should be_empty
|
435
459
|
end
|
436
460
|
|
437
461
|
it "should not contain the trademark information" do
|
438
|
-
@filedata.
|
462
|
+
@filedata.scan(%Q|[assembly: AssemblyTrademark("#{@tester.trademark}")]|).should be_empty
|
439
463
|
end
|
440
464
|
end
|
441
465
|
|
data/spec/createtask_spec.rb
CHANGED
@@ -3,8 +3,20 @@ require 'albacore/support/albacore_helper'
|
|
3
3
|
require 'fail_patch'
|
4
4
|
|
5
5
|
class SampleObject
|
6
|
+
extend AttrMethods
|
6
7
|
include Failure
|
7
8
|
include YAMLConfig
|
9
|
+
|
10
|
+
attr_array :array
|
11
|
+
attr_hash :hash
|
12
|
+
|
13
|
+
def get_array
|
14
|
+
@array
|
15
|
+
end
|
16
|
+
|
17
|
+
def get_hash
|
18
|
+
@hash
|
19
|
+
end
|
8
20
|
end
|
9
21
|
|
10
22
|
describe "when defining a task" do
|
@@ -13,7 +25,9 @@ describe "when defining a task" do
|
|
13
25
|
@sample_object.stub_method(:load_config_by_task_name){ |name|
|
14
26
|
@task_name = name
|
15
27
|
}
|
16
|
-
|
28
|
+
|
29
|
+
task_object_proc = Proc.new { @sample_object }
|
30
|
+
create_task :sampletask, task_object_proc do |obj|
|
17
31
|
@task_obj = obj
|
18
32
|
end
|
19
33
|
|
@@ -39,7 +53,7 @@ end
|
|
39
53
|
|
40
54
|
describe "when execution fails" do
|
41
55
|
before :all do
|
42
|
-
create_task :failing_task, SampleObject.new
|
56
|
+
create_task :failing_task, Proc.new { SampleObject.new }
|
43
57
|
|
44
58
|
failing_task :sample_fail do |x|
|
45
59
|
x.extend(FailPatch)
|
@@ -55,7 +69,7 @@ end
|
|
55
69
|
|
56
70
|
describe "when task args are used" do
|
57
71
|
before :all do
|
58
|
-
create_task :task_with_args, SampleObject.new
|
72
|
+
create_task :task_with_args, Proc.new { SampleObject.new }
|
59
73
|
|
60
74
|
task_with_args :sampletask_withargs, [:arg1] do |t, args|
|
61
75
|
t.extend(FailPatch)
|
@@ -71,7 +85,7 @@ end
|
|
71
85
|
|
72
86
|
describe "when calling a task method without providing a task name" do
|
73
87
|
before :all do
|
74
|
-
create_task :task_without_name, SampleObject.new
|
88
|
+
create_task :task_without_name, Proc.new { SampleObject.new }
|
75
89
|
|
76
90
|
task_without_name do |t|
|
77
91
|
@task_without_name_called = true
|
@@ -87,7 +101,7 @@ end
|
|
87
101
|
|
88
102
|
describe "when calling a task method without providing a task parameter" do
|
89
103
|
before :all do
|
90
|
-
create_task :task_without_param, SampleObject.new
|
104
|
+
create_task :task_without_param, Proc.new { SampleObject.new }
|
91
105
|
|
92
106
|
task_without_param do
|
93
107
|
@task_without_param_called = true
|
@@ -104,7 +118,7 @@ end
|
|
104
118
|
describe "when calling a task without a task definition block" do
|
105
119
|
|
106
120
|
before :all do
|
107
|
-
create_task :task_without_body, SampleObject.new
|
121
|
+
create_task :task_without_body, Proc.new { SampleObject.new }
|
108
122
|
|
109
123
|
task_without_body
|
110
124
|
|
@@ -120,3 +134,39 @@ describe "when calling a task without a task definition block" do
|
|
120
134
|
@failed.should be_false
|
121
135
|
end
|
122
136
|
end
|
137
|
+
|
138
|
+
describe "when creating two tasks and executing them" do
|
139
|
+
before :all do
|
140
|
+
create_task :multiple_instance_task, Proc.new { SampleObject.new } do |mi|
|
141
|
+
@array_values = mi.get_array
|
142
|
+
@hash_values = mi.get_hash
|
143
|
+
end
|
144
|
+
|
145
|
+
multiple_instance_task :multi_instance_1 do |mi|
|
146
|
+
mi.array 1, 2
|
147
|
+
mi.hash = { :a => :b, :c => :d }
|
148
|
+
@instance_1 = mi
|
149
|
+
end
|
150
|
+
|
151
|
+
multiple_instance_task :multi_instance_2 do |mi|
|
152
|
+
mi.array 3, 4
|
153
|
+
mi.hash = { :e => :f, :g => :h }
|
154
|
+
@instance_2 = mi
|
155
|
+
end
|
156
|
+
|
157
|
+
Rake::Task[:multi_instance_1].invoke
|
158
|
+
Rake::Task[:multi_instance_2].invoke
|
159
|
+
end
|
160
|
+
|
161
|
+
it "should specify the array values once per task" do
|
162
|
+
@array_values.should == [3, 4]
|
163
|
+
end
|
164
|
+
|
165
|
+
it "should specify the hash values once per task" do
|
166
|
+
@hash_values.should == { :e => :f, :g => :h }
|
167
|
+
end
|
168
|
+
|
169
|
+
it "should create two separate instances of the task object" do
|
170
|
+
@instance_1.object_id.should_not == @instance_2.object_id
|
171
|
+
end
|
172
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
|
2
|
+
require 'albacore/support/albacore_helper'
|
3
|
+
require 'system_patch'
|
4
|
+
|
5
|
+
class RunCommandObject
|
6
|
+
include YAMLConfig
|
7
|
+
include RunCommand
|
8
|
+
|
9
|
+
def execute
|
10
|
+
@require_valid_command = false
|
11
|
+
result = run_command "Run Command Test Object"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe "when running two instances of a command line task" do
|
16
|
+
before :all do
|
17
|
+
create_task :run_command_task, Proc.new { RunCommandObject.new } do |ex|
|
18
|
+
ex.execute
|
19
|
+
end
|
20
|
+
|
21
|
+
run_command_task :one do |x|
|
22
|
+
x.extend(SystemPatch)
|
23
|
+
x.path_to_command = "set"
|
24
|
+
x.parameters "_albacore_test = test_one"
|
25
|
+
@one = x
|
26
|
+
end
|
27
|
+
|
28
|
+
run_command_task :two do |x|
|
29
|
+
x.extend(SystemPatch)
|
30
|
+
x.path_to_command = "set"
|
31
|
+
x.parameters "_another_albacore_test = test_two"
|
32
|
+
@two = x
|
33
|
+
end
|
34
|
+
|
35
|
+
Rake::Task[:one].invoke
|
36
|
+
Rake::Task[:two].invoke
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should only pass the parameters specified to the first command" do
|
40
|
+
@one.system_command.should == "\"set\" _albacore_test = test_one"
|
41
|
+
end
|
42
|
+
|
43
|
+
it "should only pass the parameters specified to the second command" do
|
44
|
+
@two.system_command.should == "\"set\" _another_albacore_test = test_two"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
|
data/spec/spec.opts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--format specdoc
|
data/spec/xunit_spec.rb
CHANGED
@@ -4,6 +4,8 @@ require 'albacore/xunittestrunner'
|
|
4
4
|
@@xunitpath = File.join(File.dirname(__FILE__), 'support', 'Tools', 'XUnit-v1.5', 'xunit.console.exe')
|
5
5
|
@@test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'CodeCoverage', 'xunit', 'assemblies', 'TestSolution.XUnitTests.dll')
|
6
6
|
@@output_option = "/out=xunit.results.html"
|
7
|
+
@@working_dir =File.join(File.dirname(__FILE__), 'support','xunit')
|
8
|
+
@@html_output = File.join(@@working_dir,'TestSolution.XUnitTests.dll.html')
|
7
9
|
|
8
10
|
describe XUnitTestRunner, "the command parameters for an xunit runner" do
|
9
11
|
before :all do
|
@@ -18,10 +20,6 @@ describe XUnitTestRunner, "the command parameters for an xunit runner" do
|
|
18
20
|
@command_parameters.should_not include(@@xunitpath)
|
19
21
|
end
|
20
22
|
|
21
|
-
it "should include the list of assemblies" do
|
22
|
-
@command_parameters.should include("\"#{@@test_assembly}\"")
|
23
|
-
end
|
24
|
-
|
25
23
|
it "should include the list of options" do
|
26
24
|
@command_parameters.should include(@@output_option)
|
27
25
|
end
|
@@ -46,13 +44,29 @@ describe XUnitTestRunner, "the command line string for an xunit runner" do
|
|
46
44
|
end
|
47
45
|
end
|
48
46
|
|
49
|
-
|
50
47
|
describe XUnitTestRunner, "when configured correctly" do
|
51
48
|
before :all do
|
52
49
|
xunit = XUnitTestRunner.new(@@xunitpath)
|
53
50
|
xunit.assembly = @@test_assembly
|
54
51
|
xunit.options '/noshadow'
|
55
52
|
xunit.extend(FailPatch)
|
53
|
+
xunit.log_level = :verbose
|
54
|
+
|
55
|
+
xunit.execute
|
56
|
+
end
|
57
|
+
|
58
|
+
it "should execute" do
|
59
|
+
$task_failed.should be_false
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
describe XUnitTestRunner, "when multiple assemblies are passed to xunit runner" do
|
64
|
+
before :all do
|
65
|
+
xunit = XUnitTestRunner.new(@@xunitpath)
|
66
|
+
xunit.assemblies = @@test_assembly, @@test_assembly
|
67
|
+
xunit.options '/noshadow'
|
68
|
+
xunit.extend(FailPatch)
|
69
|
+
xunit.log_level = :verbose
|
56
70
|
|
57
71
|
xunit.execute
|
58
72
|
end
|
@@ -60,4 +74,70 @@ describe XUnitTestRunner, "when configured correctly" do
|
|
60
74
|
it "should execute" do
|
61
75
|
$task_failed.should be_false
|
62
76
|
end
|
63
|
-
end
|
77
|
+
end
|
78
|
+
|
79
|
+
describe XUnitTestRunner, "when zero assemblies are passed to xunit runner" do
|
80
|
+
before :all do
|
81
|
+
xunit = XUnitTestRunner.new(@@xunitpath)
|
82
|
+
xunit.options '/noshadow'
|
83
|
+
xunit.extend(FailPatch)
|
84
|
+
|
85
|
+
xunit.execute
|
86
|
+
end
|
87
|
+
|
88
|
+
it "should fail" do
|
89
|
+
$task_failed.should be_true
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
describe XUnitTestRunner, "when html_output is specified" do
|
94
|
+
before :each do
|
95
|
+
FileUtils.mkdir @@working_dir
|
96
|
+
xunit = XUnitTestRunner.new(@@xunitpath)
|
97
|
+
xunit.assemblies = @@test_assembly
|
98
|
+
xunit.html_output = File.dirname(@@html_output)
|
99
|
+
xunit.extend(FailPatch)
|
100
|
+
|
101
|
+
xunit.execute
|
102
|
+
end
|
103
|
+
|
104
|
+
it "should execute" do
|
105
|
+
$task_failed.should be_false
|
106
|
+
end
|
107
|
+
|
108
|
+
it "should write output html" do
|
109
|
+
File.exist?(@@html_output).should be_true
|
110
|
+
end
|
111
|
+
|
112
|
+
after:each do
|
113
|
+
FileUtils.rm_r @@working_dir if File.exist? @@working_dir
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
describe XUnitTestRunner, "when html_output is not a directory" do
|
118
|
+
before :each do
|
119
|
+
FileUtils.mkdir @@working_dir
|
120
|
+
strio = StringIO.new
|
121
|
+
xunit = XUnitTestRunner.new(@@xunitpath)
|
122
|
+
xunit.log_level = :verbose
|
123
|
+
xunit.log_device = strio
|
124
|
+
xunit.assemblies = @@test_assembly
|
125
|
+
xunit.html_output = @@html_output
|
126
|
+
xunit.extend(FailPatch)
|
127
|
+
|
128
|
+
xunit.execute
|
129
|
+
@log_data = strio.string
|
130
|
+
end
|
131
|
+
|
132
|
+
it "should fail" do
|
133
|
+
$task_failed.should be_true
|
134
|
+
end
|
135
|
+
|
136
|
+
it "should log a message" do
|
137
|
+
@log_data.should include('Directory is required for html_output')
|
138
|
+
end
|
139
|
+
|
140
|
+
after:each do
|
141
|
+
FileUtils.rm_r @@working_dir if File.exist? @@working_dir
|
142
|
+
end
|
143
|
+
end
|
metadata
CHANGED
@@ -5,17 +5,18 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 4
|
9
|
+
version: 0.1.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Derick Bailey
|
13
13
|
- Ben Hall
|
14
|
+
- etc
|
14
15
|
autorequire:
|
15
16
|
bindir: bin
|
16
17
|
cert_chain: []
|
17
18
|
|
18
|
-
date: 2010-
|
19
|
+
date: 2010-05-06 00:00:00 -05:00
|
19
20
|
default_executable:
|
20
21
|
dependencies:
|
21
22
|
- !ruby/object:Gem::Dependency
|
@@ -238,8 +239,10 @@ files:
|
|
238
239
|
- spec/plink_spec.rb
|
239
240
|
- spec/plinktask_spec.rb
|
240
241
|
- spec/renametask_spec.rb
|
242
|
+
- spec/runcommand_spec.rb
|
241
243
|
- spec/sftp_spec.rb
|
242
244
|
- spec/sftptask_spec.rb
|
245
|
+
- spec/spec.opts
|
243
246
|
- spec/sqlcmd_spec.rb
|
244
247
|
- spec/sqlcmdtask_spec.rb
|
245
248
|
- spec/ssh_spec.rb
|
@@ -371,6 +374,7 @@ test_files:
|
|
371
374
|
- spec/plinktask_spec.rb
|
372
375
|
- spec/plink_spec.rb
|
373
376
|
- spec/renametask_spec.rb
|
377
|
+
- spec/runcommand_spec.rb
|
374
378
|
- spec/sftptask_spec.rb
|
375
379
|
- spec/sftp_spec.rb
|
376
380
|
- spec/sqlcmdtask_spec.rb
|