albacore 0.1.5 → 0.2.0.preview1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. data/.autotest +4 -0
  2. data/README.markdown +1 -1
  3. data/VERSION +1 -1
  4. data/install_dependencies.rb +2 -3
  5. data/lib/albacore.rb +1 -0
  6. data/lib/albacore/albacoremodel.rb +28 -0
  7. data/lib/albacore/assemblyinfo.rb +5 -4
  8. data/lib/albacore/config/assemblyinfoconfig.rb +21 -0
  9. data/lib/albacore/config/config.rb +14 -0
  10. data/lib/albacore/config/cscconfig.rb +33 -0
  11. data/lib/albacore/config/docuconfig.rb +25 -0
  12. data/lib/albacore/config/execconfig.rb +22 -0
  13. data/lib/albacore/config/msbuildconfig.rb +32 -0
  14. data/lib/albacore/config/mspecconfig.rb +21 -0
  15. data/lib/albacore/config/nantconfig.rb +22 -0
  16. data/lib/albacore/config/ncoverconsoleconfig.rb +22 -0
  17. data/lib/albacore/config/ncoverreportconfig.rb +22 -0
  18. data/lib/albacore/config/ndependconfig.rb +22 -0
  19. data/lib/albacore/config/netversion.rb +23 -0
  20. data/lib/albacore/config/nunitconfig.rb +20 -0
  21. data/lib/albacore/config/specflowreportconfig.rb +27 -0
  22. data/lib/albacore/config/sqlcmdconfig.rb +22 -0
  23. data/lib/albacore/config/unzipconfig.rb +22 -0
  24. data/lib/albacore/config/xbuildconfig.rb +22 -0
  25. data/lib/albacore/config/xunitconfig.rb +22 -0
  26. data/lib/albacore/config/zipconfig.rb +22 -0
  27. data/lib/albacore/csc.rb +31 -0
  28. data/lib/albacore/docu.rb +8 -6
  29. data/lib/albacore/exec.rb +9 -3
  30. data/lib/albacore/msbuild.rb +5 -12
  31. data/lib/albacore/mspectestrunner.rb +9 -7
  32. data/lib/albacore/nant.rb +5 -4
  33. data/lib/albacore/ncoverconsole.rb +6 -9
  34. data/lib/albacore/ncoverreport.rb +8 -6
  35. data/lib/albacore/ncoverreports/codecoveragebase.rb +4 -4
  36. data/lib/albacore/ncoverreports/cyclomaticcomplexity.rb +4 -4
  37. data/lib/albacore/ncoverreports/fullcoveragereport.rb +3 -3
  38. data/lib/albacore/ncoverreports/reportfilterbase.rb +4 -4
  39. data/lib/albacore/ncoverreports/summaryreport.rb +3 -3
  40. data/lib/albacore/ndepend.rb +12 -9
  41. data/lib/albacore/nunittestrunner.rb +9 -7
  42. data/lib/albacore/specflowreport.rb +62 -0
  43. data/lib/albacore/sqlcmd.rb +8 -6
  44. data/lib/albacore/support/attrmethods.rb +7 -8
  45. data/lib/albacore/support/logging.rb +8 -4
  46. data/lib/albacore/support/openstruct.rb +13 -0
  47. data/lib/albacore/support/runcommand.rb +24 -24
  48. data/lib/albacore/support/supportlinux.rb +23 -0
  49. data/lib/albacore/support/yamlconfig.rb +2 -10
  50. data/lib/albacore/unzip.rb +14 -12
  51. data/lib/albacore/xbuild.rb +6 -5
  52. data/lib/albacore/xunittestrunner.rb +8 -6
  53. data/lib/albacore/zipdirectory.rb +27 -6
  54. data/lib/rake/csctask.rb +3 -0
  55. data/lib/rake/specflowreporttask.rb +3 -0
  56. data/lib/rake/unziptask.rb +1 -1
  57. data/rakefile.rb +21 -54
  58. data/spec/albacoremodel_spec.rb +35 -0
  59. data/spec/assemblyinfo_spec.rb +17 -0
  60. data/spec/attrmethods_spec.rb +17 -1
  61. data/spec/config_spec.rb +19 -0
  62. data/spec/createtask_spec.rb +45 -4
  63. data/spec/csc_spec.rb +87 -0
  64. data/spec/csctask_spec.rb +1 -0
  65. data/spec/docu_spec.rb +43 -1
  66. data/spec/exec_spec.rb +16 -1
  67. data/spec/msbuild_spec.rb +30 -18
  68. data/spec/mspec_spec.rb +28 -0
  69. data/spec/nant_spec.rb +20 -12
  70. data/spec/ncoverconsole_spec.rb +25 -13
  71. data/spec/ncoverreport_spec.rb +31 -18
  72. data/spec/ndepend_spec.rb +23 -2
  73. data/spec/nunittestrunner_spec.rb +48 -0
  74. data/spec/runcommand_spec.rb +59 -32
  75. data/spec/specflowreport_spec.rb +146 -0
  76. data/spec/specflowreporttask_spec.rb +48 -0
  77. data/spec/sqlcmd_spec.rb +18 -5
  78. data/spec/support/SpecFlow/TechTalk.SpecFlow.dll +0 -0
  79. data/spec/support/SpecFlow/TestSolution.SpecFlow.dll +0 -0
  80. data/spec/support/SpecFlow/TestSolution.SpecFlow.pdb +0 -0
  81. data/spec/support/SpecFlow/TestSolution.dll +0 -0
  82. data/spec/support/SpecFlow/TestSolution.pdb +0 -0
  83. data/spec/support/SpecFlow/nunit.framework.dll +0 -0
  84. data/spec/support/TestSolution/TestSolution.5.0.ReSharper.user +27 -0
  85. data/spec/support/TestSolution/TestSolution.SpecFlow/OneFeature.feature +8 -0
  86. data/spec/support/TestSolution/TestSolution.SpecFlow/OneFeature.feature.cs +73 -0
  87. data/spec/support/TestSolution/TestSolution.SpecFlow/Properties/AssemblyInfo.cs +36 -0
  88. data/spec/support/TestSolution/TestSolution.SpecFlow/StepDefinition.cs +30 -0
  89. data/spec/support/TestSolution/TestSolution.SpecFlow/TestSolution.SpecFlow.csproj +84 -0
  90. data/spec/support/TestSolution/TestSolution.sln +6 -0
  91. data/spec/support/csc/File1.cs +9 -0
  92. data/spec/support/csc/File2.cs +9 -0
  93. data/spec/support/csc/output/ignorethis.txt +1 -0
  94. data/spec/support/msbuildtestdata.rb +3 -3
  95. data/spec/support/ncoverreporttestdata.rb +2 -2
  96. data/spec/support/spec_helper.rb +2 -1
  97. data/spec/support/yamlconfig/yaml_autoconfig_test.yml +1 -1
  98. data/spec/unzip_spec.rb +15 -0
  99. data/spec/xbuild_spec.rb +15 -0
  100. data/spec/xunit_spec.rb +16 -2
  101. data/spec/yamlconfig_spec.rb +7 -6
  102. data/spec/zip_spec.rb +50 -9
  103. data/watchrtesting.rb +8 -0
  104. metadata +99 -91
  105. data/lib/albacore/expandtemplates.rb +0 -81
  106. data/lib/albacore/plink.rb +0 -49
  107. data/lib/albacore/renamer.rb +0 -17
  108. data/lib/albacore/sftp.rb +0 -42
  109. data/lib/albacore/ssh.rb +0 -44
  110. data/lib/albacore/support/albacore_helper.rb +0 -1
  111. data/lib/albacore/support/globalconfig.rb +0 -6
  112. data/lib/rake/expandtemplatestask.rb +0 -3
  113. data/lib/rake/plinktask.rb +0 -3
  114. data/lib/rake/renametask.rb +0 -3
  115. data/lib/rake/sftptask.rb +0 -3
  116. data/lib/rake/sshtask.rb +0 -3
  117. data/spec/expandtemplates_spec.rb +0 -180
  118. data/spec/expandtemplatestask_spec.rb +0 -46
  119. data/spec/plink_spec.rb +0 -62
  120. data/spec/plinktask_spec.rb +0 -46
  121. data/spec/renametask_spec.rb +0 -32
  122. data/spec/sftp_spec.rb +0 -30
  123. data/spec/sftptask_spec.rb +0 -42
  124. data/spec/ssh_spec.rb +0 -47
  125. data/spec/sshtask_spec.rb +0 -40
  126. data/spec/support/expandtemplates/datafiles/multiplevalues.yml +0 -3
  127. data/spec/support/expandtemplates/datafiles/multitemplate-specificfile.yml +0 -11
  128. data/spec/support/expandtemplates/datafiles/multitemplate.yml +0 -4
  129. data/spec/support/expandtemplates/datafiles/sample.yml +0 -1
  130. data/spec/support/expandtemplates/datafiles/sample_with_include.yml +0 -2
  131. data/spec/support/expandtemplates/datafiles/template_specific_data_file_with_include.yml +0 -5
  132. data/spec/support/expandtemplates/datafiles/template_specific_include.yml +0 -3
  133. data/spec/support/expandtemplates/templates/multipleinstance.config +0 -4
  134. data/spec/support/expandtemplates/templates/multiplevalues.config +0 -1
  135. data/spec/support/expandtemplates/templates/sample.config +0 -1
  136. data/spec/support/expandtemplatestestdata.rb +0 -77
@@ -1,18 +1,19 @@
1
- require 'albacore/support/albacore_helper'
1
+ require 'albacore/albacoremodel'
2
+ require 'albacore/config/xbuildconfig'
2
3
 
3
4
  class XBuild
4
- extend AttrMethods
5
+ include AlbacoreModel
5
6
  include RunCommand
6
- include YAMLConfig
7
- include Logging
7
+ include Configuration::XBuild
8
8
 
9
9
  attr_accessor :solution, :verbosity
10
10
  attr_array :targets
11
11
  attr_hash :properties
12
12
 
13
13
  def initialize
14
- @path_to_command = 'xbuild'
14
+ @command = 'xbuild'
15
15
  super()
16
+ update_attributes xbuild.to_hash
16
17
  end
17
18
 
18
19
  def build
@@ -1,22 +1,24 @@
1
- require 'albacore/support/albacore_helper'
1
+ require 'albacore/albacoremodel'
2
+ require 'albacore/config/xunitconfig'
2
3
 
3
4
  class XUnitTestRunner
4
- extend AttrMethods
5
+ include AlbacoreModel
5
6
  include RunCommand
6
- include YAMLConfig
7
+ include Configuration::XUnit
7
8
 
8
9
  attr_accessor :html_output
9
10
  attr_array :options,:assembly,:assemblies
10
11
 
11
- def initialize(path_to_command='')
12
- @path_to_command = path_to_command
12
+ def initialize(command=nil)
13
13
  @options=[]
14
14
  super()
15
+ update_attributes xunit.to_hash
16
+ @command = command unless command.nil?
15
17
  end
16
18
 
17
19
  def get_command_line
18
20
  command_params = []
19
- command_params << @path_to_command
21
+ command_params << @command
20
22
  command_params << get_command_parameters
21
23
  commandline = command_params.join(" ")
22
24
  @logger.debug "Build XUnit Test Runner Command Line: " + commandline
@@ -1,12 +1,12 @@
1
- require 'albacore/support/albacore_helper'
1
+ require 'albacore/albacoremodel'
2
+ require 'albacore/config/zipconfig'
2
3
  require 'zip/zip'
3
4
  require 'zip/zipfilesystem'
4
5
  include Zip
5
6
 
6
7
  class ZipDirectory
7
- extend AttrMethods
8
- include YAMLConfig
9
- include Failure
8
+ include AlbacoreModel
9
+ include Configuration::Zip
10
10
 
11
11
  attr_accessor :output_path, :output_file
12
12
  attr_accessor :flatten_zip
@@ -16,6 +16,7 @@ class ZipDirectory
16
16
  @flatten_zip = true
17
17
  @exclusions = []
18
18
  super()
19
+ update_attributes zip.to_hash
19
20
  end
20
21
 
21
22
  def package()
@@ -45,11 +46,31 @@ class ZipDirectory
45
46
  end
46
47
 
47
48
  def is_excluded(f)
48
- @exclusions.any? do |e|
49
+ expanded_exclusions.any? do |e|
49
50
  return true if e.respond_to? '~' and f =~ e
50
51
  e == f
51
52
  end
52
53
  end
54
+
55
+ def expanded_exclusions
56
+ return @expanded_exclusions unless @expanded_exclusions.nil?
57
+
58
+ regexp_exclusions, string_exclusions = @exclusions.partition {|x| x.respond_to? '~' }
59
+ @expanded_exclusions = [].concat(regexp_exclusions)
60
+
61
+ @directories_to_zip.each do |dir|
62
+ Dir.chdir(dir) do
63
+ string_exclusions.each do |ex|
64
+ exclusions = Dir.glob(ex)
65
+ exclusions = exclusions.map {|x| File.join(dir, x) } unless exclusions[0] == ex
66
+ exclusions << ex if exclusions.empty?
67
+ @expanded_exclusions += exclusions
68
+ end
69
+ end
70
+ end
71
+
72
+ @expanded_exclusions
73
+ end
53
74
 
54
75
  def zip_name()
55
76
  @output_path = set_output_path
@@ -82,4 +103,4 @@ class ZipDirectory
82
103
  zipfile.add(file_name, file_path)
83
104
  end
84
105
  end
85
- end
106
+ end
@@ -0,0 +1,3 @@
1
+ create_task :csc, Proc.new { CSC.new } do |csharp|
2
+ csharp.execute
3
+ end
@@ -0,0 +1,3 @@
1
+ create_task :specflowreport, Proc.new { SpecFlowReport.new } do |spec|
2
+ spec.execute
3
+ end
@@ -1,3 +1,3 @@
1
1
  create_task :unzip, Proc.new { Unzip.new } do |zip|
2
- zip.unzip
2
+ zip.execute
3
3
  end
data/rakefile.rb CHANGED
@@ -22,6 +22,12 @@ namespace :specs do
22
22
  t.spec_opts << @spec_opts
23
23
  end
24
24
 
25
+ desc "CSharp compiler (csc.exe) specs"
26
+ Spec::Rake::SpecTask.new :csc do |t|
27
+ t.spec_files = FileList['spec/csc*_spec.rb']
28
+ t.spec_opts << @spec_opts
29
+ end
30
+
25
31
  desc "Assembly info functional specs"
26
32
  Spec::Rake::SpecTask.new :assemblyinfo do |t|
27
33
  t.spec_files = FileList['spec/assemblyinfo*_spec.rb']
@@ -59,36 +65,12 @@ namespace :specs do
59
65
  t.spec_opts << @spec_opts
60
66
  end
61
67
 
62
- desc "SSH functional specs"
63
- Spec::Rake::SpecTask.new :ssh do |t|
64
- t.spec_files = FileList['spec/ssh*_spec.rb']
65
- t.spec_opts << @spec_opts
66
- end
67
-
68
- desc "Plink functional specs"
69
- Spec::Rake::SpecTask.new :plink do |t|
70
- t.spec_files = FileList['spec/plink*_spec.rb']
71
- t.spec_opts << @spec_opts
72
- end
73
-
74
68
  desc "Ndepend functional specs"
75
69
  Spec::Rake::SpecTask.new :ndepend do |t|
76
70
  t.spec_files = FileList['spec/ndepend*_spec.rb']
77
71
  t.spec_opts << @spec_opts
78
72
  end
79
73
 
80
- desc "SFTP functional specs"
81
- Spec::Rake::SpecTask.new :sftp do |t|
82
- t.spec_files = FileList['spec/sftp*_spec.rb']
83
- t.spec_opts << @spec_opts
84
- end
85
-
86
- desc "Expand Templates functional specs"
87
- Spec::Rake::SpecTask.new :templates do |t|
88
- t.spec_files = FileList['spec/expandtemplates*_spec.rb']
89
- t.spec_opts << @spec_opts
90
- end
91
-
92
74
  desc "Zip functional specs"
93
75
  Spec::Rake::SpecTask.new :zip do |t|
94
76
  t.spec_files = FileList['spec/zip*_spec.rb']
@@ -119,12 +101,6 @@ namespace :specs do
119
101
  t.spec_opts << @spec_opts
120
102
  end
121
103
 
122
- desc "Rename functional specs"
123
- Spec::Rake::SpecTask.new :rename do |t|
124
- t.spec_files = FileList['spec/rename*_spec.rb']
125
- t.spec_opts << @spec_opts
126
- end
127
-
128
104
  desc "Docu functional specs"
129
105
  Spec::Rake::SpecTask.new :docu do |t|
130
106
  t.spec_files = FileList['spec/docu*_spec.rb']
@@ -139,16 +115,16 @@ namespace :specs do
139
115
  end
140
116
 
141
117
  namespace :albacore do
142
- #global configuration options
143
- Albacore::yaml_config_folder = "spec/support/yamlconfig"
144
- Albacore::log_level = :verbose
118
+ Albacore.configure do |config|
119
+ config.yaml_config_folder = "spec/support/yamlconfig"
120
+ config.log_level = :verbose
121
+ end
145
122
 
146
123
  desc "Run a complete Albacore build sample"
147
124
  task :sample => ['albacore:assemblyinfo',
148
125
  'albacore:msbuild',
149
126
  'albacore:ncoverconsole',
150
127
  'albacore:ncoverreport',
151
- 'albacore:rename',
152
128
  'albacore:mspec',
153
129
  'albacore:nunit',
154
130
  'albacore:xunit']
@@ -175,7 +151,7 @@ namespace :albacore do
175
151
  File.delete(@xml_coverage) if File.exist?(@xml_coverage)
176
152
 
177
153
  ncc.log_level = :verbose
178
- ncc.path_to_command = "spec/support/Tools/NCover-v3.3/NCover.Console.exe"
154
+ ncc.command = "spec/support/Tools/NCover-v3.3/NCover.Console.exe"
179
155
  ncc.output :xml => @xml_coverage
180
156
  ncc.working_directory = "spec/support/CodeCoverage/nunit"
181
157
 
@@ -191,7 +167,7 @@ namespace :albacore do
191
167
  ncoverreport :ncoverreport => :ncoverconsole do |ncr|
192
168
  @xml_coverage = "spec/support/CodeCoverage/test-coverage.xml"
193
169
 
194
- ncr.path_to_command = "spec/support/Tools/NCover-v3.3/NCover.Reporting.exe"
170
+ ncr.command = "spec/support/Tools/NCover-v3.3/NCover.Reporting.exe"
195
171
  ncr.coverage_files @xml_coverage
196
172
 
197
173
  fullcoveragereport = NCover::FullCoverageReport.new
@@ -204,14 +180,6 @@ namespace :albacore do
204
180
  )
205
181
  end
206
182
 
207
- desc "Run the sample for renaming a File"
208
- rename do |rename|
209
- FileUtils.touch 'web.uat.config.example'
210
-
211
- rename.actual_name = 'web.uat.config.example'
212
- rename.target_name = 'web.config.example'
213
- end
214
-
215
183
  desc "Run ZipDirectory example"
216
184
  zip do |zip|
217
185
  zip.output_path = File.dirname(__FILE__)
@@ -228,19 +196,19 @@ namespace :albacore do
228
196
 
229
197
  desc "MSpec Test Runner Example"
230
198
  mspec do |mspec|
231
- mspec.path_to_command = "spec/support/Tools/Machine.Specification-v0.2/Machine.Specifications.ConsoleRunner.exe"
199
+ mspec.command = "spec/support/Tools/Machine.Specification-v0.2/Machine.Specifications.ConsoleRunner.exe"
232
200
  mspec.assemblies "spec/support/CodeCoverage/mspec/assemblies/TestSolution.MSpecTests.dll"
233
201
  end
234
202
 
235
203
  desc "NUnit Test Runner Example"
236
204
  nunit do |nunit|
237
- nunit.path_to_command = "spec/support/Tools/NUnit-v2.5/nunit-console.exe"
205
+ nunit.command = "spec/support/Tools/NUnit-v2.5/nunit-console.exe"
238
206
  nunit.assemblies "spec/support/CodeCoverage/nunit/assemblies/TestSolution.Tests.dll"
239
207
  end
240
208
 
241
209
  desc "XUnit Test Runner Example"
242
210
  xunit do |xunit|
243
- xunit.path_to_command = "spec/support/Tools/XUnit-v1.5/xunit.console.exe"
211
+ xunit.command = "spec/support/Tools/XUnit-v1.5/xunit.console.exe"
244
212
  xunit.assembly = "spec/support/CodeCoverage/xunit/assemblies/TestSolution.XUnitTests.dll"
245
213
  end
246
214
 
@@ -265,18 +233,17 @@ namespace :jeweler do
265
233
  gs.description = "Easily build your .NET solutions with Ruby and Rake, using this suite of Rake tasks."
266
234
  gs.email = "derickbailey@gmail.com"
267
235
  gs.homepage = "http://albacorebuild.net"
268
- gs.authors = ["Derick Bailey", "Ben Hall", "etc"]
236
+ gs.authors = ["Derick Bailey", "Ben Hall", "Steve Harman", "etc"]
269
237
  gs.has_rdoc = false
270
238
  gs.files.exclude("albacore.gemspec", ".gitignore", "spec/support/Tools")
271
239
 
272
240
  gs.add_dependency('rake', '>= 0.8.7')
273
- gs.add_dependency('net-ssh', '>= 2.0.15')
274
- gs.add_dependency('net-sftp', '>= 2.0.2')
275
- gs.add_dependency('rubyzip', '>= 0.9.1')
241
+ gs.add_dependency('rubyzip', '>= 0.9.4')
276
242
 
277
- gs.add_development_dependency('rspec', '>= 1.2.8')
278
- gs.add_development_dependency('jeweler', '>= 1.2.1')
243
+ gs.add_development_dependency('rspec', '>= 1.3.0')
244
+ gs.add_development_dependency('jeweler', '>= 1.4.0')
279
245
  gs.add_development_dependency('derickbailey-notamock', '>= 0.0.1')
280
- gs.add_development_dependency('jekyll', '>= 0.5.4')
246
+ gs.add_development_dependency('jekyll', '>= 0.5.7')
247
+ gs.add_development_dependency('watchr', '>= 0.6')
281
248
  end
282
249
  end
@@ -0,0 +1,35 @@
1
+ require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
+ require 'albacore/albacoremodel'
3
+
4
+ class ModelTest
5
+ include AlbacoreModel
6
+ attr_accessor :foo, :bar
7
+ attr_hash :a_hash
8
+ attr_array :a_array
9
+ end
10
+
11
+ describe "when updating object attributes with a valid set of hash keys" do
12
+ before :each do
13
+ @model = ModelTest.new
14
+ @model << {:foo => "test", :bar => "whatever"}
15
+ end
16
+
17
+ it "should set the attributes correctly" do
18
+ @model.foo.should == "test"
19
+ @model.bar.should == "whatever"
20
+ end
21
+ end
22
+
23
+ describe "when updating an object attributes with an invalid hash key" do
24
+ before :each do
25
+ @model = ModelTest.new
26
+ str = StringIO.new
27
+ @model.log_device = str
28
+ @model << {:something => "broken"}
29
+ @log = str.string
30
+ end
31
+
32
+ it "should warn about the attribute not being found" do
33
+ @log.should include("something is not a settable attribute on ModelTest")
34
+ end
35
+ end
@@ -475,3 +475,20 @@ describe AssemblyInfo, "when configuring the assembly info generator with a yaml
475
475
  @asm.company_name.should == "some company name"
476
476
  end
477
477
  end
478
+
479
+ describe AssemblyInfo, "when assembly info configuration is provided" do
480
+ let :asm do
481
+ Albacore.configure do |config|
482
+ config.assemblyinfo do |asm|
483
+ asm.company_name = "foo"
484
+ asm.version = "bar"
485
+ end
486
+ end
487
+ asm = AssemblyInfo.new
488
+ asm
489
+ end
490
+ it "should use the supplied info" do
491
+ asm.company_name.should == "foo"
492
+ asm.version.should == "bar"
493
+ end
494
+ end
@@ -50,6 +50,22 @@ describe "when setting an array attribute to an array variable using the equal s
50
50
  end
51
51
  end
52
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
+
53
69
  describe "when setting a hash attribute value without the equal sign" do
54
70
  before :each do
55
71
  class Test_Class
@@ -82,7 +98,7 @@ describe "when setting a hash attribute with a params list, using the equal sign
82
98
  end
83
99
  end
84
100
 
85
- describe "when setting a hash attribute to an array variable using the equal sign" do
101
+ describe "when setting a hash attribute to an hash variable using the equal sign" do
86
102
  before :each do
87
103
  class TestClass
88
104
  extend AttrMethods
@@ -0,0 +1,19 @@
1
+ require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
+ require 'albacore/albacoremodel'
3
+
4
+ class ConfigTest
5
+ include AlbacoreModel
6
+ end
7
+
8
+ describe "when configuring log level to verbose" do
9
+ let :test do
10
+ Albacore.configure do |config|
11
+ config.log_level = :verbose
12
+ end
13
+ test = ConfigTest.new
14
+ end
15
+
16
+ it "should set the log level for any model" do
17
+ test.log_level.should == :verbose
18
+ end
19
+ end
@@ -1,11 +1,9 @@
1
1
  require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
- require 'albacore/support/albacore_helper'
2
+ require 'albacore/albacoremodel'
3
3
  require 'fail_patch'
4
4
 
5
5
  class SampleObject
6
- extend AttrMethods
7
- include Failure
8
- include YAMLConfig
6
+ include AlbacoreModel
9
7
 
10
8
  attr_array :array
11
9
  attr_hash :hash
@@ -19,6 +17,15 @@ class SampleObject
19
17
  end
20
18
  end
21
19
 
20
+ class RunCommandObject
21
+ include AlbacoreModel
22
+ include RunCommand
23
+
24
+ def execute
25
+ result = run_command "Run Command Test Object"
26
+ end
27
+ end
28
+
22
29
  describe "when defining a task" do
23
30
  before :all do
24
31
  @sample_object = SampleObject.stub_instance()
@@ -170,3 +177,37 @@ describe "when creating two tasks and executing them" do
170
177
  @instance_1.object_id.should_not == @instance_2.object_id
171
178
  end
172
179
  end
180
+
181
+ describe "when running two instances of a command line task" do
182
+ before :all do
183
+ create_task :run_command_task, Proc.new { RunCommandObject.new } 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
+