albacore 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. data/EULA.txt +1 -1
  2. data/VERSION +1 -1
  3. data/lib/albacore.rb +4 -4
  4. data/lib/albacore/ncoverconsole.rb +4 -4
  5. data/lib/albacore/ncoverreport.rb +3 -3
  6. data/lib/albacore/ndepend.rb +3 -3
  7. data/lib/albacore/nunittestrunner.rb +1 -1
  8. data/lib/albacore/plink.rb +4 -3
  9. data/lib/albacore/renamer.rb +17 -0
  10. data/lib/albacore/sqlcmd.rb +3 -3
  11. data/lib/albacore/support/failure.rb +1 -8
  12. data/lib/rake/assemblyinfotask.rb +2 -16
  13. data/lib/rake/docutask.rb +2 -16
  14. data/lib/rake/exectask.rb +3 -18
  15. data/lib/rake/expandtemplatestask.rb +2 -15
  16. data/lib/rake/msbuildtask.rb +2 -17
  17. data/lib/rake/mspectask.rb +2 -16
  18. data/lib/rake/nanttask.rb +2 -16
  19. data/lib/rake/ncoverconsoletask.rb +3 -17
  20. data/lib/rake/ncoverreporttask.rb +3 -17
  21. data/lib/rake/ndependtask.rb +3 -21
  22. data/lib/rake/nunittask.rb +3 -17
  23. data/lib/rake/plinktask.rb +3 -23
  24. data/lib/rake/renametask.rb +2 -19
  25. data/lib/rake/sftptask.rb +3 -16
  26. data/lib/rake/sqlcmdtask.rb +2 -16
  27. data/lib/rake/sshtask.rb +2 -15
  28. data/lib/rake/support/albacoretask.rb +16 -6
  29. data/lib/rake/support/createtask.rb +20 -0
  30. data/lib/rake/unziptask.rb +2 -16
  31. data/lib/rake/xbuildtask.rb +4 -19
  32. data/lib/rake/xunittask.rb +2 -16
  33. data/lib/rake/ziptask.rb +2 -16
  34. data/rakefile.rb +6 -6
  35. data/spec/assemblyinfo_spec.rb +2 -0
  36. data/spec/assemblyinfotask_spec.rb +13 -12
  37. data/spec/createtask_spec.rb +70 -0
  38. data/spec/docutask_spec.rb +34 -21
  39. data/spec/exec_spec.rb +2 -1
  40. data/spec/exectask_spec.rb +25 -10
  41. data/spec/expandtemplatestask_spec.rb +25 -10
  42. data/spec/msbuild_spec.rb +2 -1
  43. data/spec/msbuildtask_spec.rb +25 -10
  44. data/spec/mspectask_spec.rb +25 -10
  45. data/spec/nant_spec.rb +2 -1
  46. data/spec/nanttask_spec.rb +24 -9
  47. data/spec/ncoverconsole_spec.rb +16 -8
  48. data/spec/ncoverconsoletask_spec.rb +25 -10
  49. data/spec/ncoverreport_spec.rb +27 -13
  50. data/spec/ncoverreporttask_spec.rb +25 -10
  51. data/spec/ndepend_spec.rb +3 -1
  52. data/spec/ndependtask_spec.rb +37 -22
  53. data/spec/nunittask_spec.rb +25 -10
  54. data/spec/nunittestrunner_spec.rb +3 -3
  55. data/spec/patches/fail_patch.rb +9 -0
  56. data/spec/plink_spec.rb +1 -0
  57. data/spec/plinktask_spec.rb +37 -22
  58. data/spec/renametask_spec.rb +13 -11
  59. data/spec/sftptask_spec.rb +11 -10
  60. data/spec/sqlcmd_spec.rb +4 -2
  61. data/spec/sqlcmdtask_spec.rb +11 -10
  62. data/spec/sshtask_spec.rb +11 -10
  63. data/spec/support/spec_helper.rb +2 -1
  64. data/spec/xunit_spec.rb +2 -2
  65. data/spec/xunittask_spec.rb +11 -10
  66. data/spec/ziptask_spec.rb +12 -11
  67. metadata +10 -7
  68. data/spec/patches/tasklib_patch.rb +0 -12
@@ -8,6 +8,7 @@ describe Exec, "when executing a command with parameters" do
8
8
  @cmd = Exec.new
9
9
  @cmd.log_level = :verbose
10
10
  @cmd.extend(SystemPatch)
11
+ @cmd.extend(FailPatch)
11
12
  @cmd.path_to_command = @@nunit
12
13
  @cmd.parameters "--help"
13
14
  @cmd.execute
@@ -18,6 +19,6 @@ describe Exec, "when executing a command with parameters" do
18
19
  end
19
20
 
20
21
  it "should not fail" do
21
- @cmd.failed.should be_false
22
+ $task_failed.should be_false
22
23
  end
23
24
  end
@@ -1,14 +1,14 @@
1
1
  require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
2
  require 'albacore/exec'
3
3
  require 'rake/exectask'
4
- require 'tasklib_patch'
4
+ require 'fail_patch'
5
5
 
6
- describe Albacore::ExecTask, "when running" do
6
+ describe "when running" do
7
7
  before :all do
8
- task = Albacore::ExecTask.new(:exec) do |t|
8
+ exec :exec do |t|
9
+ t.extend(FailPatch)
9
10
  @yielded_object = t
10
11
  end
11
- task.extend(TasklibPatch)
12
12
  Rake::Task[:exec].invoke
13
13
  end
14
14
 
@@ -17,15 +17,30 @@ describe Albacore::ExecTask, "when running" do
17
17
  end
18
18
  end
19
19
 
20
- describe Albacore::ExecTask, "when execution fails" do
20
+ describe "when execution fails" do
21
21
  before :all do
22
- @task = Albacore::ExecTask.new(:failingtask)
23
- @task.extend(TasklibPatch)
24
- @task.fail
25
- Rake::Task["failingtask"].invoke
22
+ exec :exec_fail do |t|
23
+ t.extend(FailPatch)
24
+ @yielded_object = t
25
+ end
26
+ Rake::Task[:exec_fail].invoke
26
27
  end
27
28
 
28
29
  it "should fail the rake task" do
29
- @task.task_failed.should be_true
30
+ $task_failed.should be_true
30
31
  end
31
32
  end
33
+
34
+ describe "when task args are used" do
35
+ before :all do
36
+ exec :exectask_withargs, [:arg1] do |exec, args|
37
+ exec.extend(FailPatch)
38
+ @args = args
39
+ end
40
+ Rake::Task["exectask_withargs"].invoke("test")
41
+ end
42
+
43
+ it "should provide the task args" do
44
+ @args.arg1.should == "test"
45
+ end
46
+ end
@@ -1,14 +1,14 @@
1
1
  require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
2
  require 'albacore/expandtemplates'
3
3
  require 'rake/expandtemplatestask'
4
- require 'tasklib_patch'
4
+ require 'fail_patch'
5
5
 
6
- describe Albacore::ExpandTemplatesTask, "when running" do
6
+ describe "when running" do
7
7
  before :each do
8
- task = Albacore::ExpandTemplatesTask.new(:expandtemplates) do |t|
8
+ expandtemplates :expandtemplates do |t|
9
+ t.extend(FailPatch)
9
10
  @yielded_object = t
10
11
  end
11
- task.extend(TasklibPatch)
12
12
  Rake::Task[:expandtemplates].invoke
13
13
  end
14
14
 
@@ -17,15 +17,30 @@ describe Albacore::ExpandTemplatesTask, "when running" do
17
17
  end
18
18
  end
19
19
 
20
- describe Albacore::ExpandTemplatesTask, "when execution fails" do
20
+ describe "when execution fails" do
21
21
  before :each do
22
- @task = Albacore::ExpandTemplatesTask.new(:failingtask)
23
- @task.extend(TasklibPatch)
24
- @task.fail
25
- Rake::Task["failingtask"].invoke
22
+ expandtemplates :expand_fail do |t|
23
+ t.extend(FailPatch)
24
+ t.fail
25
+ end
26
+ Rake::Task[:expand_fail].invoke
26
27
  end
27
28
 
28
29
  it "should fail the rake task" do
29
- @task.task_failed.should be_true
30
+ $task_failed.should be_true
31
+ end
32
+ end
33
+
34
+ describe "when task args are used" do
35
+ before :all do
36
+ expandtemplates :expandtask_withargs, [:arg1] do |t, args|
37
+ t.extend(FailPatch)
38
+ @args = args
39
+ end
40
+ Rake::Task[:expandtask_withargs].invoke("test")
41
+ end
42
+
43
+ it "should provide the task args" do
44
+ @args.arg1.should == "test"
30
45
  end
31
46
  end
@@ -31,8 +31,8 @@ describe MSBuild, "when building with no solution specified" do
31
31
  it_should_behave_like "prepping msbuild"
32
32
 
33
33
  before :all do
34
+ @msbuild.extend(FailPatch)
34
35
  @msbuild.build
35
-
36
36
  @log_data = @strio.string
37
37
  end
38
38
 
@@ -67,6 +67,7 @@ describe MSBuild, "when an invalid msbuild path is specified" do
67
67
  before :all do
68
68
  @testdata = MSBuildTestData.new
69
69
  msbuild = @testdata.msbuild "/an invalid path/does not exist.exe"
70
+ msbuild.extend(FailPatch)
70
71
  @strio = StringIO.new
71
72
  msbuild.log_device = @strio
72
73
  msbuild.log_level = :verbose
@@ -1,14 +1,14 @@
1
1
  require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
2
  require 'albacore/msbuild'
3
3
  require 'rake/msbuildtask'
4
- require 'tasklib_patch'
4
+ require 'fail_patch'
5
5
 
6
- describe Albacore::MSBuildTask, "when running" do
6
+ describe "when running" do
7
7
  before :all do
8
- task = Albacore::MSBuildTask.new(:msbuild) do |t|
8
+ msbuild :msbuild do |t|
9
+ t.extend(FailPatch)
9
10
  @yielded_object = t
10
11
  end
11
- task.extend(TasklibPatch)
12
12
  Rake::Task[:msbuild].invoke
13
13
  end
14
14
 
@@ -17,15 +17,30 @@ describe Albacore::MSBuildTask, "when running" do
17
17
  end
18
18
  end
19
19
 
20
- describe Albacore::MSBuildTask, "when execution fails" do
20
+ describe "when execution fails" do
21
21
  before :all do
22
- @task = Albacore::MSBuildTask.new(:failingtask)
23
- @task.extend(TasklibPatch)
24
- @task.fail
25
- Rake::Task["failingtask"].invoke
22
+ msbuild :msbuild_fail do |t|
23
+ t.extend(FailPatch)
24
+ t.fail
25
+ end
26
+ Rake::Task[:msbuild_fail].invoke
26
27
  end
27
28
 
28
29
  it "should fail the rake task" do
29
- @task.task_failed.should == true
30
+ $task_failed.should == true
31
+ end
32
+ end
33
+
34
+ describe "when task args are used" do
35
+ before :all do
36
+ msbuild :msbuildtask_withargs, [:arg1] do |t, args|
37
+ t.extend(FailPatch)
38
+ @args = args
39
+ end
40
+ Rake::Task[:msbuildtask_withargs].invoke("test")
41
+ end
42
+
43
+ it "should provide the task args" do
44
+ @args.arg1.should == "test"
30
45
  end
31
46
  end
@@ -1,14 +1,14 @@
1
1
  require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
2
  require 'albacore/mspectestrunner'
3
3
  require 'rake/mspectask'
4
- require 'tasklib_patch'
4
+ require 'fail_patch'
5
5
 
6
- describe Albacore::MSpecTask, "when running" do
6
+ describe "when running" do
7
7
  before :all do
8
- task = Albacore::MSpecTask.new(:mspec) do |t|
8
+ mspec :mspec do |t|
9
+ t.extend(FailPatch)
9
10
  @yielded_object = t
10
11
  end
11
- task.extend(TasklibPatch)
12
12
  Rake::Task[:mspec].invoke
13
13
  end
14
14
 
@@ -17,15 +17,30 @@ describe Albacore::MSpecTask, "when running" do
17
17
  end
18
18
  end
19
19
 
20
- describe Albacore::MSpecTask, "when execution fails" do
20
+ describe "when execution fails" do
21
21
  before :all do
22
- @task = Albacore::MSpecTask.new(:failingtask)
23
- @task.extend(TasklibPatch)
24
- @task.fail
25
- Rake::Task["failingtask"].invoke
22
+ mspec :mspec_fail do |t|
23
+ t.extend(FailPatch)
24
+ t.fail
25
+ end
26
+ Rake::Task[:mspec_fail].invoke
26
27
  end
27
28
 
28
29
  it "should fail the rake task" do
29
- @task.task_failed.should == true
30
+ $task_failed.should == true
31
+ end
32
+ end
33
+
34
+ describe "when task args are used" do
35
+ before :all do
36
+ mspec :mspectask_withargs, [:arg1] do |t, args|
37
+ t.extend(FailPatch)
38
+ @args = args
39
+ end
40
+ Rake::Task[:mspectask_withargs].invoke("test")
41
+ end
42
+
43
+ it "should provide the task args" do
44
+ @args.arg1.should == "test"
30
45
  end
31
46
  end
@@ -19,12 +19,13 @@ describe NAnt, "when a nant path is not specified" do
19
19
  it_should_behave_like "prepping nant"
20
20
 
21
21
  before :all do
22
+ @nant.extend(FailPatch)
22
23
  @log_data = @strio.string
23
24
  @nant.run
24
25
  end
25
26
 
26
27
  it "should fail" do
27
- @nant.failed.should == true
28
+ $task_failed.should == true
28
29
  end
29
30
 
30
31
  it "should log the missing command path" do
@@ -1,14 +1,14 @@
1
1
  require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
2
  require 'albacore/nant'
3
3
  require 'rake/nanttask'
4
- require 'tasklib_patch'
4
+ require 'fail_patch'
5
5
 
6
- describe Albacore::NAntTask, "when running" do
6
+ describe "when running" do
7
7
  before :all do
8
- task = Albacore::NAntTask.new(:nant) do |t|
8
+ nant :nant do |t|
9
+ t.extend(FailPatch)
9
10
  @yielded_object = t
10
11
  end
11
- task.extend(TasklibPatch)
12
12
  Rake::Task[:nant].invoke
13
13
  end
14
14
 
@@ -17,15 +17,30 @@ describe Albacore::NAntTask, "when running" do
17
17
  end
18
18
  end
19
19
 
20
- describe Albacore::NAntTask, "when execution fails" do
20
+ describe "when execution fails" do
21
21
  before :all do
22
- @task = Albacore::NAntTask.new(:nant_failingtask)
23
- @task.extend(TasklibPatch)
24
- @task.fail
22
+ nant :nant_failingtask do |t|
23
+ t.extend(FailPatch)
24
+ t.fail
25
+ end
25
26
  Rake::Task[:nant_failingtask].invoke
26
27
  end
27
28
 
28
29
  it "should fail the rake task" do
29
- @task.task_failed.should == true
30
+ $task_failed.should == true
31
+ end
32
+ end
33
+
34
+ describe "when task args are used" do
35
+ before :all do
36
+ nant :nanttask_withargs, [:arg1] do |t, args|
37
+ t.extend(FailPatch)
38
+ @args = args
39
+ end
40
+ Rake::Task[:nanttask_withargs].invoke("test")
41
+ end
42
+
43
+ it "should provide the task args" do
44
+ @args.arg1.should == "test"
30
45
  end
31
46
  end
@@ -43,7 +43,7 @@ describe NCoverConsole, "when specifying assemblies with spaces in the name" do
43
43
  @ncc.path_to_command = @testdata.ncoverpath
44
44
  @ncc.output :xml => @testdata.xml_coverage_output
45
45
  @ncc.working_directory = @testdata.working_directory
46
- @ncc.cover_assemblies "with spaces/TestSolution"
46
+ @ncc.cover_assemblies "assemblies/with spaces/TestSolution"
47
47
 
48
48
  nunit = NUnitTestRunner.new(@testdata.nunitpath)
49
49
  nunit.assemblies @testdata.test_assembly_with_spaces
@@ -54,7 +54,7 @@ describe NCoverConsole, "when specifying assemblies with spaces in the name" do
54
54
  end
55
55
 
56
56
  it "should provide coverage for the specified assemblies" do
57
- @ncc.system_command.should include("//assemblies \"with spaces/TestSolution\"")
57
+ @ncc.system_command.should include("//assemblies \"assemblies/with spaces/TestSolution\"")
58
58
  end
59
59
 
60
60
  end
@@ -92,6 +92,8 @@ describe NCoverConsole, "when running with the defaults" do
92
92
  @ncc = NCoverConsole.new
93
93
 
94
94
  @ncc.extend(SystemPatch)
95
+ @ncc.extend(FailPatch)
96
+
95
97
  @ncc.path_to_command = @testdata.ncoverpath
96
98
  @ncc.testrunner = NUnitTestRunner.new
97
99
 
@@ -109,6 +111,8 @@ describe NCoverConsole, "when opting out of registering the ncover dll" do
109
111
  @ncc = NCoverConsole.new
110
112
 
111
113
  @ncc.extend(SystemPatch)
114
+ @ncc.extend(FailPatch)
115
+
112
116
  @ncc.path_to_command = @testdata.ncoverpath
113
117
  @ncc.no_registration
114
118
  @ncc.testrunner = NUnitTestRunner.new
@@ -158,6 +162,8 @@ describe NCoverConsole, "when analyzing a test suite with failing tests" do
158
162
  ncc.log_device = strio
159
163
 
160
164
  ncc.extend(SystemPatch)
165
+ ncc.extend(FailPatch)
166
+
161
167
  ncc.log_level = :verbose
162
168
  ncc.path_to_command = @testdata.ncoverpath
163
169
  ncc.output :xml => @testdata.xml_coverage_output
@@ -170,12 +176,11 @@ describe NCoverConsole, "when analyzing a test suite with failing tests" do
170
176
  ncc.testrunner = nunit
171
177
 
172
178
  ncc.run
173
- @failed = ncc.failed
174
179
  @log_data = strio.string
175
180
  end
176
181
 
177
182
  it "should return a failure code" do
178
- @failed.should == true
183
+ $task_failed.should == true
179
184
  end
180
185
 
181
186
  it "should log a failure message" do
@@ -187,10 +192,11 @@ describe NCoverConsole, "when running without a testrunner" do
187
192
  before :all do
188
193
  @testdata = NCoverConsoleTestData.new
189
194
  ncc = NCoverConsole.new()
195
+ ncc.extend(FailPatch)
190
196
  strio = StringIO.new
191
197
  ncc.log_device = strio
192
198
 
193
- @result = ncc.run
199
+ ncc.run
194
200
  @log_data = strio.string
195
201
  end
196
202
 
@@ -198,8 +204,8 @@ describe NCoverConsole, "when running without a testrunner" do
198
204
  @log_data.should include("testrunner cannot be nil.")
199
205
  end
200
206
 
201
- it "should return a failure code" do
202
- @result.should == false
207
+ it "should fail the task" do
208
+ $task_failed.should be_true
203
209
  end
204
210
  end
205
211
 
@@ -287,6 +293,8 @@ describe NCoverConsole, "when producing a report with machine.specifications" do
287
293
  @ncc = NCoverConsole.new()
288
294
 
289
295
  @ncc.extend(SystemPatch)
296
+ @ncc.extend(FailPatch)
297
+
290
298
  @ncc.log_level = :verbose
291
299
  @ncc.path_to_command = @testdata.ncoverpath
292
300
  @ncc.output :xml => @testdata.xml_coverage_output
@@ -301,7 +309,7 @@ describe NCoverConsole, "when producing a report with machine.specifications" do
301
309
  end
302
310
 
303
311
  it "should not fail" do
304
- @ncc.failed.should be_false
312
+ $task_failed.should be_false
305
313
  end
306
314
 
307
315
  it "should produce the html report" do
@@ -1,14 +1,14 @@
1
1
  require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
2
  require 'albacore/ncoverconsole'
3
3
  require 'rake/ncoverconsoletask'
4
- require 'tasklib_patch'
4
+ require 'fail_patch'
5
5
 
6
- describe Albacore::NCoverConsoleTask, "when running" do
6
+ describe "when running" do
7
7
  before :all do
8
- task = Albacore::NCoverConsoleTask.new(:ncoverconsole) do |t|
8
+ ncoverconsole :ncoverconsole do |t|
9
+ t.extend(FailPatch)
9
10
  @yielded_object = t
10
11
  end
11
- task.extend(TasklibPatch)
12
12
  Rake::Task[:ncoverconsole].invoke
13
13
  end
14
14
 
@@ -17,15 +17,30 @@ describe Albacore::NCoverConsoleTask, "when running" do
17
17
  end
18
18
  end
19
19
 
20
- describe Albacore::NCoverConsoleTask, "when execution fails" do
20
+ describe "when execution fails" do
21
21
  before :all do
22
- @task = Albacore::NCoverConsoleTask.new(:failingtask)
23
- @task.extend(TasklibPatch)
24
- @task.fail
25
- Rake::Task["failingtask"].invoke
22
+ ncoverconsole :ncoverconsole_fail do |t|
23
+ t.extend(FailPatch)
24
+ t.fail
25
+ end
26
+ Rake::Task[:ncoverconsole_fail].invoke
26
27
  end
27
28
 
28
29
  it "should fail the rake task" do
29
- @task.task_failed.should == true
30
+ $task_failed.should == true
31
+ end
32
+ end
33
+
34
+ describe "when task args are used" do
35
+ before :all do
36
+ ncoverconsole :ncoverconsoletask_withargs, [:arg1] do |t, args|
37
+ t.extend(FailPatch)
38
+ @args = args
39
+ end
40
+ Rake::Task[:ncoverconsoletask_withargs].invoke("test")
41
+ end
42
+
43
+ it "should provide the task args" do
44
+ @args.arg1.should == "test"
30
45
  end
31
46
  end