albacore 0.2.0.preview1 → 0.2.0.preview2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. data/README.markdown +7 -2
  2. data/VERSION +1 -1
  3. data/install_dependencies.rb +1 -1
  4. data/lib/albacore.rb +6 -17
  5. data/lib/albacore/albacoretask.rb +43 -0
  6. data/lib/albacore/assemblyinfo.rb +10 -7
  7. data/lib/albacore/config/assemblyinfoconfig.rb +4 -12
  8. data/lib/albacore/config/config.rb +16 -8
  9. data/lib/albacore/config/cscconfig.rb +2 -7
  10. data/lib/albacore/config/docuconfig.rb +3 -5
  11. data/lib/albacore/config/execconfig.rb +4 -11
  12. data/lib/albacore/config/msbuildconfig.rb +2 -5
  13. data/lib/albacore/config/mspectestrunnerconfig.rb +15 -0
  14. data/lib/albacore/config/nantconfig.rb +4 -11
  15. data/lib/albacore/config/ncoverconsoleconfig.rb +4 -11
  16. data/lib/albacore/config/ncoverreportconfig.rb +4 -11
  17. data/lib/albacore/config/ndependconfig.rb +4 -11
  18. data/lib/albacore/config/netversion.rb +0 -2
  19. data/lib/albacore/config/nunittestrunnerconfig.rb +14 -0
  20. data/lib/albacore/config/specflowreportconfig.rb +2 -5
  21. data/lib/albacore/config/sqlcmdconfig.rb +4 -11
  22. data/lib/albacore/config/unzipconfig.rb +4 -11
  23. data/lib/albacore/config/xbuildconfig.rb +4 -11
  24. data/lib/albacore/config/xunittestrunnerconfig.rb +15 -0
  25. data/lib/albacore/config/zipdirectoryconfig.rb +15 -0
  26. data/lib/albacore/csc.rb +31 -5
  27. data/lib/albacore/docu.rb +2 -3
  28. data/lib/albacore/exec.rb +3 -5
  29. data/lib/albacore/msbuild.rb +3 -3
  30. data/lib/albacore/mspectestrunner.rb +5 -6
  31. data/lib/albacore/nant.rb +4 -6
  32. data/lib/albacore/ncoverconsole.rb +4 -6
  33. data/lib/albacore/ncoverreport.rb +4 -6
  34. data/lib/albacore/ncoverreports/codecoveragebase.rb +2 -2
  35. data/lib/albacore/ncoverreports/cyclomaticcomplexity.rb +2 -2
  36. data/lib/albacore/ncoverreports/fullcoveragereport.rb +0 -8
  37. data/lib/albacore/ncoverreports/reportfilterbase.rb +2 -2
  38. data/lib/albacore/ncoverreports/summaryreport.rb +0 -4
  39. data/lib/albacore/ndepend.rb +4 -6
  40. data/lib/albacore/nunittestrunner.rb +4 -5
  41. data/lib/albacore/specflowreport.rb +2 -2
  42. data/lib/albacore/sqlcmd.rb +33 -11
  43. data/lib/albacore/support/createtask.rb +30 -0
  44. data/lib/albacore/support/runcommand.rb +21 -30
  45. data/lib/albacore/support/updateattributes.rb +13 -0
  46. data/lib/albacore/unzip.rb +3 -5
  47. data/lib/albacore/xbuild.rb +5 -6
  48. data/lib/albacore/xunittestrunner.rb +4 -5
  49. data/lib/albacore/zipdirectory.rb +5 -6
  50. data/rakefile.rb +7 -8
  51. data/spec/albacoremodel_spec.rb +20 -2
  52. data/spec/assemblyinfo_spec.rb +27 -14
  53. data/spec/config_spec.rb +17 -2
  54. data/spec/createtask_spec.rb +51 -28
  55. data/spec/csc_spec.rb +135 -3
  56. data/spec/docu_spec.rb +11 -14
  57. data/spec/exec_spec.rb +1 -1
  58. data/spec/msbuild_spec.rb +9 -9
  59. data/spec/nant_spec.rb +4 -4
  60. data/spec/ncoverconsole_spec.rb +13 -13
  61. data/spec/ncoverreport_spec.rb +17 -17
  62. data/spec/ndepend_spec.rb +6 -6
  63. data/spec/runcommand_spec.rb +22 -3
  64. data/spec/sqlcmd_spec.rb +154 -12
  65. data/spec/support/assemblyinfotester.rb +1 -1
  66. data/spec/support/spec_helper.rb +2 -2
  67. data/spec/yamlconfig_spec.rb +3 -3
  68. data/spec/zip_spec.rb +4 -4
  69. metadata +32 -119
  70. data/lib/albacore/albacoremodel.rb +0 -28
  71. data/lib/albacore/config/mspecconfig.rb +0 -21
  72. data/lib/albacore/config/nunitconfig.rb +0 -20
  73. data/lib/albacore/config/xunitconfig.rb +0 -22
  74. data/lib/albacore/config/zipconfig.rb +0 -22
  75. data/lib/rake/assemblyinfotask.rb +0 -3
  76. data/lib/rake/csctask.rb +0 -3
  77. data/lib/rake/docutask.rb +0 -3
  78. data/lib/rake/exectask.rb +0 -3
  79. data/lib/rake/msbuildtask.rb +0 -3
  80. data/lib/rake/mspectask.rb +0 -3
  81. data/lib/rake/nanttask.rb +0 -3
  82. data/lib/rake/ncoverconsoletask.rb +0 -3
  83. data/lib/rake/ncoverreporttask.rb +0 -3
  84. data/lib/rake/ndependtask.rb +0 -3
  85. data/lib/rake/nunittask.rb +0 -3
  86. data/lib/rake/specflowreporttask.rb +0 -3
  87. data/lib/rake/sqlcmdtask.rb +0 -3
  88. data/lib/rake/support/albacoretask.rb +0 -30
  89. data/lib/rake/support/createtask.rb +0 -21
  90. data/lib/rake/unziptask.rb +0 -3
  91. data/lib/rake/xbuildtask.rb +0 -7
  92. data/lib/rake/xunittask.rb +0 -3
  93. data/lib/rake/ziptask.rb +0 -3
  94. data/spec/assemblyinfotask_spec.rb +0 -32
  95. data/spec/csctask_spec.rb +0 -1
  96. data/spec/docutask_spec.rb +0 -52
  97. data/spec/exectask_spec.rb +0 -46
  98. data/spec/msbuildtask_spec.rb +0 -46
  99. data/spec/mspectask_spec.rb +0 -46
  100. data/spec/nanttask_spec.rb +0 -46
  101. data/spec/ncoverconsoletask_spec.rb +0 -46
  102. data/spec/ncoverreporttask_spec.rb +0 -46
  103. data/spec/ndependtask_spec.rb +0 -46
  104. data/spec/nunittask_spec.rb +0 -46
  105. data/spec/spec.opts +0 -1
  106. data/spec/specflowreporttask_spec.rb +0 -48
  107. data/spec/sqlcmdtask_spec.rb +0 -32
  108. data/spec/support/AssemblyInfo/assemblyinfo.yml +0 -2
  109. data/spec/support/CodeCoverage/mspec/assemblies/Machine.Specifications.NUnit.dll +0 -0
  110. data/spec/support/CodeCoverage/mspec/assemblies/Machine.Specifications.dll +0 -0
  111. data/spec/support/CodeCoverage/mspec/assemblies/TestSolution.MSpecTests.dll +0 -0
  112. data/spec/support/CodeCoverage/mspec/assemblies/TestSolution.dll +0 -0
  113. data/spec/support/CodeCoverage/mspec/assemblies/nunit.framework.dll +0 -0
  114. data/spec/support/CodeCoverage/nunit/assemblies/TestSolution.Tests.dll +0 -0
  115. data/spec/support/CodeCoverage/nunit/assemblies/TestSolution.dll +0 -0
  116. data/spec/support/CodeCoverage/nunit/assemblies/nunit.framework.dll +0 -0
  117. data/spec/support/CodeCoverage/nunit/assemblies/with spaces/TestSolution.Tests.dll +0 -0
  118. data/spec/support/CodeCoverage/nunit/assemblies/with spaces/TestSolution.dll +0 -0
  119. data/spec/support/CodeCoverage/nunit/assemblies/with spaces/nunit.framework.dll +0 -0
  120. data/spec/support/CodeCoverage/nunit/failing_assemblies/TestSolution.FailingTests.dll +0 -0
  121. data/spec/support/CodeCoverage/nunit/failing_assemblies/nunit.framework.dll +0 -0
  122. data/spec/support/CodeCoverage/report/coverage.xml +0 -4578
  123. data/spec/support/CodeCoverage/xunit/assemblies/TestSolution.XUnitTests.dll +0 -0
  124. data/spec/support/CodeCoverage/xunit/assemblies/TestSolution.dll +0 -0
  125. data/spec/support/CodeCoverage/xunit/assemblies/xunit.dll +0 -0
  126. data/spec/support/CodeCoverage/xunit/assemblies/xunit.xml +0 -2306
  127. data/spec/support/SpecFlow/TechTalk.SpecFlow.dll +0 -0
  128. data/spec/support/SpecFlow/TestSolution.SpecFlow.dll +0 -0
  129. data/spec/support/SpecFlow/TestSolution.SpecFlow.pdb +0 -0
  130. data/spec/support/SpecFlow/TestSolution.dll +0 -0
  131. data/spec/support/SpecFlow/TestSolution.pdb +0 -0
  132. data/spec/support/SpecFlow/nunit.framework.dll +0 -0
  133. data/spec/support/TestSolution/NDependProject.xml +0 -315
  134. data/spec/support/TestSolution/TestSolution.5.0.ReSharper.user +0 -27
  135. data/spec/support/TestSolution/TestSolution.FailingTests/FailingTestFixture.cs +0 -19
  136. data/spec/support/TestSolution/TestSolution.FailingTests/Properties/AssemblyInfo.cs +0 -36
  137. data/spec/support/TestSolution/TestSolution.FailingTests/TestSolution.FailingTests.csproj +0 -63
  138. data/spec/support/TestSolution/TestSolution.MSpecTests/Properties/AssemblyInfo.cs +0 -36
  139. data/spec/support/TestSolution/TestSolution.MSpecTests/SomeSpecTest.cs +0 -18
  140. data/spec/support/TestSolution/TestSolution.MSpecTests/TestSolution.MSpecTests.csproj +0 -77
  141. data/spec/support/TestSolution/TestSolution.SpecFlow/OneFeature.feature +0 -8
  142. data/spec/support/TestSolution/TestSolution.SpecFlow/OneFeature.feature.cs +0 -73
  143. data/spec/support/TestSolution/TestSolution.SpecFlow/Properties/AssemblyInfo.cs +0 -36
  144. data/spec/support/TestSolution/TestSolution.SpecFlow/StepDefinition.cs +0 -30
  145. data/spec/support/TestSolution/TestSolution.SpecFlow/TestSolution.SpecFlow.csproj +0 -84
  146. data/spec/support/TestSolution/TestSolution.Tests/Properties/AssemblyInfo.cs +0 -36
  147. data/spec/support/TestSolution/TestSolution.Tests/SomeTestFixture.cs +0 -23
  148. data/spec/support/TestSolution/TestSolution.Tests/TestSolution.Tests.csproj +0 -69
  149. data/spec/support/TestSolution/TestSolution.XUnitTests/Class1.cs +0 -19
  150. data/spec/support/TestSolution/TestSolution.XUnitTests/FailingTestFixture.cs +0 -14
  151. data/spec/support/TestSolution/TestSolution.XUnitTests/Properties/AssemblyInfo.cs +0 -36
  152. data/spec/support/TestSolution/TestSolution.XUnitTests/TestSolution.XUnitTests.csproj +0 -70
  153. data/spec/support/TestSolution/TestSolution.build +0 -25
  154. data/spec/support/TestSolution/TestSolution.sln +0 -50
  155. data/spec/support/TestSolution/TestSolution/Class1.cs +0 -17
  156. data/spec/support/TestSolution/TestSolution/Properties/AssemblyInfo.cs +0 -36
  157. data/spec/support/TestSolution/TestSolution/TestSolution.csproj +0 -59
  158. data/spec/support/csc/File1.cs +0 -9
  159. data/spec/support/csc/File2.cs +0 -9
  160. data/spec/support/csc/output/ignorethis.txt +0 -1
  161. data/spec/support/test.yml +0 -4
  162. data/spec/support/yamlconfig/msbuild.yml +0 -5
  163. data/spec/support/yamlconfig/yaml_autoconfig_test.yml +0 -1
  164. data/spec/support/zip/files/subfolder/sub file.txt +0 -1
  165. data/spec/support/zip/files/testfile.txt +0 -1
  166. data/spec/xunittask_spec.rb +0 -32
  167. data/spec/ziptask_spec.rb +0 -33
@@ -1,21 +0,0 @@
1
- require 'ostruct'
2
- require 'albacore/support/openstruct'
3
-
4
- module Configuration
5
- module MSpec
6
-
7
- def self.mspecconfig
8
- @mspecconfig ||= OpenStruct.new.extend(OpenStructToHash)
9
- end
10
-
11
- def mspec
12
- config = MSpec.mspecconfig
13
- yield(config) if block_given?
14
- config
15
- end
16
- end
17
- end
18
-
19
- class Albacore::Configuration
20
- include Configuration::MSpec
21
- end
@@ -1,20 +0,0 @@
1
- require 'albacore/support/openstruct'
2
-
3
- module Configuration
4
- module NUnit
5
- @config = OpenStruct.new.extend(OpenStructToHash).extend(NUnit)
6
- def self.nunitconfig
7
- @config
8
- end
9
-
10
- def nunit
11
- config = NUnit.nunitconfig
12
- yield(config) if block_given?
13
- config
14
- end
15
- end
16
- end
17
-
18
- class Albacore::Configuration
19
- include Configuration::NUnit
20
- end
@@ -1,22 +0,0 @@
1
- require 'ostruct'
2
- require 'albacore/support/openstruct'
3
-
4
- module Configuration
5
- module XUnit
6
- @xunitconfig = OpenStruct.new.extend(OpenStructToHash)
7
-
8
- def self.xunitconfig
9
- @xunitconfig
10
- end
11
-
12
- def xunit
13
- config = XUnit.xunitconfig
14
- yield(config) if block_given?
15
- config
16
- end
17
- end
18
- end
19
-
20
- class Albacore::Configuration
21
- include Configuration::XUnit
22
- end
@@ -1,22 +0,0 @@
1
- require 'ostruct'
2
- require 'albacore/support/openstruct'
3
-
4
- module Configuration
5
- module Zip
6
- @zipconfig = OpenStruct.new.extend(OpenStructToHash)
7
-
8
- def self.zipconfig
9
- @zipconfig
10
- end
11
-
12
- def zip
13
- config = Zip.zipconfig
14
- yield(config) if block_given?
15
- config
16
- end
17
- end
18
- end
19
-
20
- class Albacore::Configuration
21
- include Configuration::Zip
22
- end
@@ -1,3 +0,0 @@
1
- create_task :assemblyinfo, Proc.new { AssemblyInfo.new } do |asm|
2
- asm.write
3
- end
@@ -1,3 +0,0 @@
1
- create_task :csc, Proc.new { CSC.new } do |csharp|
2
- csharp.execute
3
- end
@@ -1,3 +0,0 @@
1
- create_task :docu, Proc.new { Docu.new } do |doc|
2
- doc.execute
3
- end
@@ -1,3 +0,0 @@
1
- create_task :exec, Proc.new { Exec.new } do |ex|
2
- ex.execute
3
- end
@@ -1,3 +0,0 @@
1
- create_task :msbuild, Proc.new { MSBuild.new } do |msbuild|
2
- msbuild.build
3
- end
@@ -1,3 +0,0 @@
1
- create_task :mspec, Proc.new { MSpecTestRunner.new } do |mspec|
2
- mspec.execute
3
- end
@@ -1,3 +0,0 @@
1
- create_task :nant, Proc.new { NAnt.new } do |nant|
2
- nant.run
3
- end
@@ -1,3 +0,0 @@
1
- create_task :ncoverconsole, Proc.new { NCoverConsole.new } do |ncover|
2
- ncover.run
3
- end
@@ -1,3 +0,0 @@
1
- create_task :ncoverreport, Proc.new { NCoverReport.new } do |ncoverreport|
2
- ncoverreport.run
3
- end
@@ -1,3 +0,0 @@
1
- create_task :ndepend, Proc.new { NDepend.new } do |cmd|
2
- cmd.run
3
- end
@@ -1,3 +0,0 @@
1
- create_task :nunit, Proc.new { NUnitTestRunner.new } do |n|
2
- n.execute
3
- end
@@ -1,3 +0,0 @@
1
- create_task :specflowreport, Proc.new { SpecFlowReport.new } do |spec|
2
- spec.execute
3
- end
@@ -1,3 +0,0 @@
1
- create_task :sqlcmd, Proc.new { SQLCmd.new } do |cmd|
2
- cmd.run
3
- end
@@ -1,30 +0,0 @@
1
- require 'rake/tasklib'
2
-
3
- module Albacore
4
- class AlbacoreTask < ::Rake::TaskLib
5
- attr_accessor :name
6
-
7
- def initialize(name, *args, &block)
8
- @block = block
9
- args = args.insert(0, name)
10
- define name, args
11
- end
12
-
13
- def define(name, args)
14
- task *args do |task, task_args|
15
- @task_args = task_args
16
- execute name.to_s
17
- end
18
- end
19
-
20
- def call_task_block(obj)
21
- if !@block.nil?
22
- if @block.arity == 1
23
- @block.call(obj)
24
- else
25
- @block.call(obj, @task_args)
26
- end
27
- end
28
- end
29
- end
30
- end
@@ -1,21 +0,0 @@
1
- def create_task(taskname, task_object_proc, &execute_body)
2
- taskclass = :"Albacore_TaskFor_#{taskname}"
3
- taskmethod = taskname.to_s.downcase.to_sym
4
-
5
- Object.class_eval(<<-EOF, __FILE__, __LINE__)
6
- def #{taskmethod}(name=:#{taskname}, *args, &block)
7
- Albacore.const_get("#{taskclass}").new(name, *args, &block)
8
- end
9
- EOF
10
-
11
- Albacore.class_eval do
12
- const_set(taskclass, Class.new(Albacore::AlbacoreTask) do
13
- define_method :execute do |name|
14
- task_object = task_object_proc.call
15
- task_object.load_config_by_task_name(name)
16
- call_task_block(task_object)
17
- execute_body.call(task_object) unless execute_body.nil?
18
- end
19
- end)
20
- end
21
- end
@@ -1,3 +0,0 @@
1
- create_task :unzip, Proc.new { Unzip.new } do |zip|
2
- zip.execute
3
- end
@@ -1,7 +0,0 @@
1
- create_task :xbuild, Proc.new { XBuild.new } do |xb|
2
- xb.build
3
- end
4
-
5
- create_task :mono, Proc.new { XBuild.new } do |xb|
6
- xb.build
7
- end
@@ -1,3 +0,0 @@
1
- create_task :xunit, Proc.new { XUnitTestRunner.new } do |x|
2
- x.execute
3
- end
@@ -1,3 +0,0 @@
1
- create_task :zip, Proc.new { ZipDirectory.new } do |z|
2
- z.package
3
- end
@@ -1,32 +0,0 @@
1
- require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
- require 'albacore/assemblyinfo'
3
- require 'rake/assemblyinfotask'
4
- require 'fail_patch'
5
-
6
- describe "when running" do
7
- before :all do
8
- assemblyinfo :assemblyinfo do |asm|
9
- asm.extend(FailPatch)
10
- @yielded_object = asm
11
- end
12
- Rake::Task["assemblyinfo"].invoke
13
- end
14
-
15
- it "should yield the assembly info api" do
16
- @yielded_object.kind_of?(AssemblyInfo).should == true
17
- end
18
- end
19
-
20
- describe "when execution fails" do
21
- before :all do
22
- assemblyinfo :failingtask do |asm|
23
- asm.extend(FailPatch)
24
- asm.fail
25
- end
26
- Rake::Task["failingtask"].invoke
27
- end
28
-
29
- it "should fail the rake task" do
30
- $task_failed.should == true
31
- end
32
- end
@@ -1 +0,0 @@
1
-
@@ -1,52 +0,0 @@
1
- require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
- require 'albacore/docu'
3
- require 'rake/docutask'
4
- require 'fail_patch'
5
- require 'system_patch'
6
- require 'docu_patch'
7
-
8
- describe "when running" do
9
- before :all do
10
- docu :docu do |d|
11
- d.assemblies 'test.dll'
12
- d.command_result = true
13
- @yielded_object = d
14
- end
15
- Rake::Task[:docu].invoke
16
- end
17
-
18
- it "should yield the docu api" do
19
- @yielded_object.kind_of?(Docu).should be_true
20
- end
21
- end
22
-
23
- describe "when execution fails" do
24
- before :all do
25
- docu :docu_fail do |d|
26
- d.extend(FailPatch)
27
- d.assemblies 'test.dll'
28
- d.command_result = true
29
- d.fail
30
- end
31
- Rake::Task[:docu_fail].invoke
32
- end
33
-
34
- it "should fail the rake task" do
35
- $task_failed.should be_true
36
- end
37
- end
38
-
39
- describe "when task args are used" do
40
- before :all do
41
- docu :docutask_withargs, [:arg1] do |d, args|
42
- d.assemblies 'test.dll'
43
- d.command_result = true
44
- @args = args
45
- end
46
- Rake::Task["docutask_withargs"].invoke("test")
47
- end
48
-
49
- it "should provide the task args" do
50
- @args.arg1.should == "test"
51
- end
52
- end
@@ -1,46 +0,0 @@
1
- require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
- require 'albacore/exec'
3
- require 'rake/exectask'
4
- require 'fail_patch'
5
-
6
- describe "when running" do
7
- before :all do
8
- exec :exec do |t|
9
- t.extend(FailPatch)
10
- @yielded_object = t
11
- end
12
- Rake::Task[:exec].invoke
13
- end
14
-
15
- it "should yield the exec api" do
16
- @yielded_object.kind_of?(Exec).should == true
17
- end
18
- end
19
-
20
- describe "when execution fails" do
21
- before :all do
22
- exec :exec_fail do |t|
23
- t.extend(FailPatch)
24
- @yielded_object = t
25
- end
26
- Rake::Task[:exec_fail].invoke
27
- end
28
-
29
- it "should fail the rake task" do
30
- $task_failed.should be_true
31
- end
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,46 +0,0 @@
1
- require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
- require 'albacore/msbuild'
3
- require 'rake/msbuildtask'
4
- require 'fail_patch'
5
-
6
- describe "when running" do
7
- before :all do
8
- msbuild :msbuild do |t|
9
- t.extend(FailPatch)
10
- @yielded_object = t
11
- end
12
- Rake::Task[:msbuild].invoke
13
- end
14
-
15
- it "should yield the msbuild api" do
16
- @yielded_object.kind_of?(MSBuild).should == true
17
- end
18
- end
19
-
20
- describe "when execution fails" do
21
- before :all do
22
- msbuild :msbuild_fail do |t|
23
- t.extend(FailPatch)
24
- t.fail
25
- end
26
- Rake::Task[:msbuild_fail].invoke
27
- end
28
-
29
- it "should fail the rake task" do
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"
45
- end
46
- end
@@ -1,46 +0,0 @@
1
- require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
- require 'albacore/mspectestrunner'
3
- require 'rake/mspectask'
4
- require 'fail_patch'
5
-
6
- describe "when running" do
7
- before :all do
8
- mspec :mspec do |t|
9
- t.extend(FailPatch)
10
- @yielded_object = t
11
- end
12
- Rake::Task[:mspec].invoke
13
- end
14
-
15
- it "should yield the mspec api" do
16
- @yielded_object.kind_of?(MSpecTestRunner).should be_true
17
- end
18
- end
19
-
20
- describe "when execution fails" do
21
- before :all do
22
- mspec :mspec_fail do |t|
23
- t.extend(FailPatch)
24
- t.fail
25
- end
26
- Rake::Task[:mspec_fail].invoke
27
- end
28
-
29
- it "should fail the rake task" do
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"
45
- end
46
- end