albacore 0.2.6 → 0.2.7

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.
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,136 +0,0 @@
1
- require 'spec_helper'
2
- require 'albacore/support/attrmethods'
3
-
4
- describe "when setting an array attribute value without the equal sign" do
5
- before :each do
6
- class Test_Class
7
- extend AttrMethods
8
- attr_array :test
9
- end
10
-
11
- @test = Test_Class.new
12
- @test.test 1, 2, 3, 4
13
- end
14
-
15
- it "should set the array to the specified values" do
16
- @test.test.length.should be(4)
17
- end
18
- end
19
-
20
- describe "when setting an array attribute with a params list, using the equal sign" do
21
- before :each do
22
- class Test_Class
23
- extend AttrMethods
24
- attr_array :test
25
- end
26
-
27
- @test = Test_Class.new
28
- @test.test = 1, 2, 3, 4
29
- end
30
-
31
- it "should set the array to the specified values" do
32
- @test.test.length.should be(4)
33
- end
34
- end
35
-
36
- describe "when setting an array attribute to an array variable using the equal sign" do
37
- before :each do
38
- class TestClass
39
- extend AttrMethods
40
- attr_array :test
41
- end
42
-
43
- test_values = [1, 2, 3, 4, 5]
44
- @test = TestClass.new
45
- @test.test = test_values
46
- end
47
-
48
- it "should set the array to the values contained in the variable" do
49
- @test.test.length.should be(5)
50
- end
51
- end
52
-
53
- describe "when setting an array attribute to an array without the equal sign" do
54
- before :each do
55
- class TestClass
56
- extend AttrMethods
57
- attr_array :test
58
- end
59
-
60
- @test = TestClass.new
61
- @test.test [1, 2, 3, 4, 5, 6]
62
- end
63
-
64
- it "should set the array to the values specified" do
65
- @test.test.length.should be(6)
66
- end
67
- end
68
-
69
- describe "when setting a hash attribute value without the equal sign" do
70
- before :each do
71
- class Test_Class
72
- extend AttrMethods
73
- attr_hash :test
74
- end
75
-
76
- @test = Test_Class.new
77
- @test.test "a" => "b", "c" => "d"
78
- end
79
-
80
- it "should set the hash to the specified values" do
81
- @test.test.length.should be(2)
82
- end
83
- end
84
-
85
- describe "when setting a hash attribute with a params list, using the equal sign" do
86
- before :each do
87
- class Test_Class
88
- extend AttrMethods
89
- attr_hash :test
90
- end
91
-
92
- @test = Test_Class.new
93
- @test.test = {"a" => "b", "c" => "d"}
94
- end
95
-
96
- it "should set the hash to the specified values" do
97
- @test.test.length.should be(2)
98
- end
99
- end
100
-
101
- describe "when setting a hash attribute to an hash variable using the equal sign" do
102
- before :each do
103
- class TestClass
104
- extend AttrMethods
105
- attr_hash :test
106
- end
107
-
108
- test_values = {"a" => "b", "c" => "d", "e" => "f"}
109
- @test = TestClass.new
110
- @test.test = test_values
111
- end
112
-
113
- it "should set the hash to the values contained in the variable" do
114
- @test.test.length.should be(3)
115
- end
116
- end
117
-
118
- describe "when setting a hash attribute to a hash across multiple lines" do
119
- before :each do
120
- class TestClass
121
- extend AttrMethods
122
- attr_hash :test
123
- end
124
-
125
- @test = TestClass.new
126
- @test.test(
127
- :a => "b",
128
- :c => "d",
129
- :e => "f"
130
- )
131
- end
132
-
133
- it "should set the hash to the values" do
134
- @test.test.length.should be(3)
135
- end
136
- end
@@ -1,34 +0,0 @@
1
- require 'spec_helper'
2
- require 'albacore/albacoretask'
3
- require 'albacore/config/config'
4
-
5
- class ConfigTest
6
- include Albacore::Task
7
- end
8
-
9
- module ConfigModuleTest
10
- include Albacore::Configuration
11
-
12
- def mixin_worked
13
- true
14
- end
15
- end
16
-
17
- describe "when configuring log level to verbose" do
18
- let :test do
19
- Albacore.configure do |config|
20
- config.log_level = :verbose
21
- end
22
- test = ConfigTest.new
23
- end
24
-
25
- it "should set the log level for any model" do
26
- test.log_level.should == :verbose
27
- end
28
- end
29
-
30
- describe "when including Albacore::Configuration in a module" do
31
- it "should mix the module into the Albacore.configuration" do
32
- Albacore.configuration.mixin_worked.should be_true
33
- end
34
- end
@@ -1,236 +0,0 @@
1
- require 'spec_helper'
2
- require 'albacore/albacoretask'
3
- require 'fail_patch'
4
-
5
- class SampleObject
6
- include Albacore::Task
7
-
8
- attr_array :array
9
- attr_hash :hash
10
-
11
- def get_array
12
- @array
13
- end
14
-
15
- def get_hash
16
- @hash
17
- end
18
-
19
- def execute
20
- end
21
- end
22
-
23
- class RunCommandObject
24
- include Albacore::Task
25
- include Albacore::RunCommand
26
-
27
- def execute
28
- result = run_command "Run Command Test Object"
29
- end
30
- end
31
-
32
- class ConfigByNameOverride < SampleObject
33
- attr_accessor :task_name
34
- def load_config_by_task_name(name)
35
- @task_name = name
36
- end
37
- end
38
-
39
- describe "when defining a task" do
40
- before :all do
41
- Albacore.create_task :sampletask, ConfigByNameOverride
42
-
43
- sampletask :sample do |x|
44
- @config_obj = x
45
- end
46
- Rake::Task[:sample].invoke
47
- end
48
-
49
- it "should yield the object for configuration" do
50
- @config_obj.class.should == ConfigByNameOverride
51
- end
52
-
53
- it "should yield the object for execution" do
54
- @task_obj.should == @sample_object
55
- end
56
-
57
- it "should call the yaml configuration by task name" do
58
- @config_obj.task_name.should == :sample
59
- end
60
- end
61
-
62
- describe "when execution fails" do
63
- before :all do
64
- Albacore.create_task :failing_task, SampleObject
65
-
66
- failing_task :sample_fail do |x|
67
- x.extend(FailPatch)
68
- x.fail
69
- end
70
- Rake::Task[:sample_fail].invoke
71
- end
72
-
73
- it "should fail the rake task" do
74
- $task_failed.should == true
75
- end
76
- end
77
-
78
- describe "when task args are used" do
79
- before :all do
80
- Albacore.create_task :task_with_args, SampleObject
81
-
82
- task_with_args :sampletask_withargs, [:arg1] do |t, args|
83
- @args = args
84
- end
85
-
86
- Rake::Task[:sampletask_withargs].invoke("test")
87
- end
88
-
89
- it "should provide the task args" do
90
- @args.arg1.should == "test"
91
- end
92
- end
93
-
94
- describe "when calling a task method without providing a task name" do
95
- before :all do
96
- Albacore.create_task :task_without_name, SampleObject
97
-
98
- task_without_name do |t|
99
- @task_without_name_called = true
100
- end
101
-
102
- Rake::Task[:task_without_name].invoke
103
- end
104
-
105
- it "should create the the task by the task method's name" do
106
- @task_without_name_called = true
107
- end
108
- end
109
-
110
- describe "when calling a task method without providing a task parameter" do
111
- before :all do
112
- Albacore.create_task :task_without_param, SampleObject
113
-
114
- task_without_param do
115
- @task_without_param_called = true
116
- end
117
-
118
- Rake::Task[:task_without_param].invoke
119
- end
120
-
121
- it "should execute the task with no parameter provided" do
122
- @task_without_param_called = true
123
- end
124
- end
125
-
126
- describe "when calling a task without a task definition block" do
127
-
128
- before :all do
129
- Albacore.create_task :task_without_body, SampleObject
130
-
131
- task_without_body
132
-
133
- begin
134
- Rake::Task[:task_without_body].invoke
135
- @failed = false
136
- rescue
137
- @failed = true
138
- end
139
- end
140
-
141
- it "should execute the task" do
142
- @failed.should be_false
143
- end
144
- end
145
-
146
- describe "when creating two tasks and executing them" do
147
- before :all do
148
- Albacore.create_task :multiple_instance_task, SampleObject
149
-
150
- multiple_instance_task :multi_instance_1 do |mi|
151
- mi.array 1, 2
152
- mi.hash = { :a => :b, :c => :d }
153
- @instance_1 = mi
154
- end
155
-
156
- multiple_instance_task :multi_instance_2 do |mi|
157
- mi.array 3, 4
158
- mi.hash = { :e => :f, :g => :h }
159
- @instance_2 = mi
160
- end
161
-
162
- Rake::Task[:multi_instance_1].invoke
163
- Rake::Task[:multi_instance_2].invoke
164
- end
165
-
166
- it "should specify the array values once per task" do
167
- @instance_1.array.should == [1, 2]
168
- @instance_2.array.should == [3, 4]
169
- end
170
-
171
- it "should specify the hash values once per task" do
172
- @instance_1.hash.should == { :a => :b, :c => :d }
173
- @instance_2.hash.should == { :e => :f, :g => :h }
174
- end
175
-
176
- it "should create two separate instances of the task object" do
177
- @instance_1.object_id.should_not == @instance_2.object_id
178
- end
179
- end
180
-
181
- describe "when running two instances of a command line task" do
182
- before :all do
183
- Albacore.create_task :run_command_task, RunCommandObject do |ex|
184
- ex.execute
185
- end
186
-
187
- run_command_task :one do |x|
188
- x.extend(SystemPatch)
189
- x.command = "set"
190
- x.parameters "_albacore_test = test_one"
191
- @one = x
192
- end
193
-
194
- run_command_task :two do |x|
195
- x.extend(SystemPatch)
196
- x.command = "set"
197
- x.parameters "_another_albacore_test = test_two"
198
- @two = x
199
- end
200
-
201
- Rake::Task[:one].invoke
202
- Rake::Task[:two].invoke
203
- end
204
-
205
- it "should only pass the parameters specified to the first command" do
206
- @one.system_command.should == "\"set\" _albacore_test = test_one"
207
- end
208
-
209
- it "should only pass the parameters specified to the second command" do
210
- @two.system_command.should == "\"set\" _another_albacore_test = test_two"
211
- end
212
- end
213
-
214
- describe "when adding prerequisites through the rake api" do
215
- let :obj do
216
- Albacore.create_task :dependency_task, Object
217
-
218
- require 'ostruct'
219
- obj = OpenStruct.new
220
-
221
- task :first_task
222
- task :second_task do
223
- obj.dependency_called = true
224
- end
225
-
226
- firsttask = Rake::Task[:first_task]
227
- firsttask.enhance [:second_task]
228
- firsttask.invoke
229
-
230
- obj
231
- end
232
-
233
- it "should call the dependent tasks" do
234
- obj.dependency_called.should be_true
235
- end
236
- end
@@ -1,253 +0,0 @@
1
- require 'spec_helper'
2
- require 'albacore/csc'
3
-
4
- Albacore.configure do |config|
5
- config.log_level = :verbose
6
- end
7
-
8
- describe CSC, "when supplying a file list with 2 files to compile" do
9
- let :csc do
10
- csc = CSC.new
11
- csc.compile = FileList["File1.cs", "File2.cs"]
12
- csc.extend(SystemPatch)
13
- csc.disable_system = true
14
- csc.execute
15
- csc
16
- end
17
-
18
- it "should provide the first file to the compiler" do
19
- csc.system_command.should include("\"File1.cs\"")
20
- end
21
-
22
- it "should provide the second file to the compiler" do
23
- csc.system_command.should include("\"File2.cs\"")
24
- end
25
- end
26
-
27
- # TODO: If designed by contract this is an unncessary responsibility of the class.
28
- # It should be removed and only validate that the parameter is being specified as CSC expects it.
29
- describe CSC, "when targeting a library and an output file" do
30
- before :each do
31
- @folder = File.join(File.expand_path(File.dirname(__FILE__)), "support", "csc")
32
- csc = CSC.new
33
-
34
- csc.compile FileList[File.join(@folder, "File1.cs")]
35
- csc.target = :library
36
- csc.output = File.join(@folder, "output", "File1.dll")
37
- csc.execute
38
- end
39
-
40
- it "should produce the .dll file in the correct location" do
41
- File.exist?(File.join(@folder, "output", "File1.dll")).should be_true
42
- end
43
- end
44
-
45
- describe CSC, "when referencing existing assemblies" do
46
- let :csc do
47
- csc = CSC.new
48
- csc.references "foobar.dll"
49
-
50
- csc.extend(SystemPatch)
51
- csc.disable_system = true
52
- csc.execute
53
- csc
54
- end
55
-
56
- it "should specify the reference on the command line" do
57
- csc.system_command.should include("\"/reference:foobar.dll\"")
58
- end
59
- end
60
-
61
- describe CSC, "when configuring the version to use" do
62
- let :csc do
63
- Albacore.configure do |config|
64
- config.csc.use :net35
65
- end
66
- csc = CSC.new
67
- csc
68
- end
69
-
70
- it "should use the configured version" do
71
- win_dir = ENV['windir'] || ENV['WINDIR'] || "C:/Windows"
72
- csc.command.should == File.join(win_dir.dup, 'Microsoft.NET', 'Framework', 'v3.5', 'csc.exe')
73
- end
74
- end
75
-
76
- describe CSC, "when version to use has been configured and overriding" do
77
- let :csc do
78
- Albacore.configure do |config|
79
- config.csc.use :net2
80
- end
81
- csc = CSC.new
82
- csc.use :net35
83
- csc
84
- end
85
-
86
- it "should use the override version" do
87
- win_dir = ENV['windir'] || ENV['WINDIR'] || "C:/Windows"
88
- csc.command.should == File.join(win_dir.dup, 'Microsoft.NET', 'Framework', 'v3.5', 'csc.exe')
89
- end
90
- end
91
-
92
- describe CSC, "when specifying 2 resources to include" do
93
- let :csc do
94
- csc = CSC.new
95
- csc.resources "../some/file.resource", "another.resource"
96
-
97
- csc.extend(SystemPatch)
98
- csc.disable_system = true
99
- csc.execute
100
- csc
101
- end
102
-
103
- it "should include the first resource" do
104
- csc.system_command.should include("/res:../some/file.resource")
105
- end
106
-
107
- it "should include the second resource" do
108
- csc.system_command.should include("/res:another.resource")
109
- end
110
- end
111
-
112
- describe CSC, "when specifying the optimize option" do
113
- let :csc do
114
- csc = CSC.new
115
- csc.optimize = true
116
-
117
- csc.extend(SystemPatch)
118
- csc.disable_system = true
119
- csc.execute
120
- csc
121
- end
122
-
123
- it "should supply the optimize parameter" do
124
- csc.system_command.should include("/optimize")
125
- end
126
- end
127
-
128
- describe CSC, "when specifying debug information be generated" do
129
- let :csc do
130
- csc = CSC.new
131
- csc.debug = true
132
-
133
- csc.extend(SystemPatch)
134
- csc.disable_system = true
135
- csc.execute
136
- csc
137
- end
138
-
139
- it "should provide the debug parameter" do
140
- csc.system_command.should include("/debug")
141
- end
142
- end
143
-
144
- describe CSC, "when specifying full debug information be generated" do
145
- let :csc do
146
- csc = CSC.new
147
- csc.debug = :full
148
-
149
- csc.extend(SystemPatch)
150
- csc.disable_system = true
151
- csc.execute
152
- csc
153
- end
154
-
155
- it "should provide the full debug parameter" do
156
- csc.system_command.should include("/debug:full")
157
- end
158
- end
159
-
160
- describe CSC, "when specifying pdbonly debug information be generated" do
161
- let :csc do
162
- csc = CSC.new
163
- csc.debug = :pdbonly
164
-
165
- csc.extend(SystemPatch)
166
- csc.disable_system = true
167
- csc.execute
168
- csc
169
- end
170
-
171
- it "should provide the pdbonly debug parameter" do
172
- csc.system_command.should include("/debug:pdbonly")
173
- end
174
- end
175
-
176
- describe CSC, "when specifying debug information not be generated" do
177
- let :csc do
178
- csc = CSC.new
179
- csc.debug = false
180
-
181
- csc.extend(SystemPatch)
182
- csc.disable_system = true
183
- csc.execute
184
- csc
185
- end
186
-
187
- it "should not provide the debug parameter" do
188
- csc.system_command.should_not include("/debug")
189
- end
190
- end
191
-
192
- describe CSC, "when specifying an xml document to generate" do
193
- let :csc do
194
- csc = CSC.new
195
- csc.doc = "../path/to/docfile.xml"
196
-
197
- csc.extend(SystemPatch)
198
- csc.disable_system = true
199
- csc.execute
200
- csc
201
- end
202
-
203
- it "should provide the documentation parmaeter" do
204
- csc.system_command.should include("/doc:../path/to/docfile.xml")
205
- end
206
- end
207
-
208
- describe CSC, "when defining processor symbols" do
209
- let :csc do
210
- csc = CSC.new
211
- csc.define :symbol1, :symbol2
212
-
213
- csc.extend(SystemPatch)
214
- csc.disable_system = true
215
- csc.execute
216
- csc
217
- end
218
-
219
- it "should specify the defined symbols" do
220
- csc.system_command.should include("/define:symbol1;symbol2")
221
- end
222
- end
223
-
224
- describe CSC, "when specifying main entry point be generated" do
225
- let :csc do
226
- csc = CSC.new
227
- csc.main = "Program.Main"
228
-
229
- csc.extend(SystemPatch)
230
- csc.disable_system = true
231
- csc.execute
232
- csc
233
- end
234
-
235
- it "should provide the main parameter" do
236
- csc.system_command.should include("/main:Program.Main")
237
- end
238
- end
239
-
240
- describe CSC, "when specifying main entry point not be generated" do
241
- let :csc do
242
- csc = CSC.new
243
-
244
- csc.extend(SystemPatch)
245
- csc.disable_system = true
246
- csc.execute
247
- csc
248
- end
249
-
250
- it "should not provide the main parameter" do
251
- csc.system_command.should_not include("/main")
252
- end
253
- end