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,46 +0,0 @@
1
- require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
- require 'albacore/expandtemplates'
3
- require 'rake/expandtemplatestask'
4
- require 'fail_patch'
5
-
6
- describe "when running" do
7
- before :each do
8
- expandtemplates :expandtemplates do |t|
9
- t.extend(FailPatch)
10
- @yielded_object = t
11
- end
12
- Rake::Task[:expandtemplates].invoke
13
- end
14
-
15
- it "should yield the expand template api" do
16
- @yielded_object.kind_of?(ExpandTemplates).should == true
17
- end
18
- end
19
-
20
- describe "when execution fails" do
21
- before :each do
22
- expandtemplates :expand_fail do |t|
23
- t.extend(FailPatch)
24
- t.fail
25
- end
26
- Rake::Task[:expand_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
- 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"
45
- end
46
- end
data/spec/plink_spec.rb DELETED
@@ -1,62 +0,0 @@
1
- require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
- require 'albacore/plink'
3
-
4
- describe PLink, 'when executing a command over plink' do
5
- before :each do
6
- @cmd = PLink.new
7
- @cmd.extend(SystemPatch)
8
- @cmd.extend(FailPatch)
9
- @cmd.path_to_command ="C:\\plink.exe"
10
- @cmd.host = "testhost"
11
-
12
- end
13
-
14
- it "should attempt to execute plink.exe" do
15
- @cmd.run
16
- @cmd.system_command.should include("plink.exe")
17
- end
18
-
19
- it "should attempt to connect to the test host on the default port (22)" do
20
- @cmd.run
21
- @cmd.system_command.should include("@testhost")
22
- @cmd.system_command.should include("-P 22")
23
- end
24
-
25
- it "should connect to the test host on a non default port 2200" do
26
- @cmd.port = 2200
27
- @cmd.run
28
- @cmd.system_command.should include("-P 2200")
29
- end
30
-
31
- it "should connect to the host with a username" do
32
- expected_user = "dummyuser"
33
- @cmd.user = expected_user
34
- @cmd.run
35
- @cmd.system_command.should include("#{expected_user}@")
36
- end
37
-
38
- it "should run remote commands in batch mode" do
39
- @cmd.run
40
- @cmd.system_command.should include("-batch")
41
- end
42
-
43
- it "should run commands in verbose mode" do
44
- @cmd.verbose = true
45
- @cmd.run
46
- @cmd.system_command.should include("-v")
47
- end
48
-
49
- it "should include the remote command" do
50
- expected_remote_exe = "C:\ThisIsTheRemoteExe.exe"
51
- @cmd.commands expected_remote_exe
52
- @cmd.run
53
- @cmd.system_command.should include(expected_remote_exe)
54
- end
55
-
56
- it "should include the remote command with parameters" do
57
- expected_remote_exe = "C:\\ThisIsTheRemoteExe.exe --help -o -p"
58
- @cmd.commands expected_remote_exe
59
- @cmd.run
60
- @cmd.system_command.should include(expected_remote_exe)
61
- end
62
- end
@@ -1,46 +0,0 @@
1
- require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
- require 'albacore/plink'
3
- require 'rake/plinktask'
4
- require 'fail_patch'
5
-
6
- describe "when running" do
7
- before :all do
8
- plink :plink do |t|
9
- t.extend(FailPatch)
10
- @yielded_object = t
11
- end
12
- Rake::Task[:plink].invoke
13
- end
14
-
15
- it "should yield the command api" do
16
- @yielded_object.kind_of?(PLink).should == true
17
- end
18
- end
19
-
20
- describe "when execution fails" do
21
- before :all do
22
- plink :plink_fail do |t|
23
- t.extend(FailPatch)
24
- t.fail
25
- end
26
- Rake::Task[:plink_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
- plink :plinktask_withargs, [:arg1] do |t, args|
37
- t.extend(FailPatch)
38
- @args = args
39
- end
40
- Rake::Task[:plinktask_withargs].invoke("test")
41
- end
42
-
43
- it "should provide the task args" do
44
- @args.arg1.should == "test"
45
- end
46
- end
@@ -1,32 +0,0 @@
1
- require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
- require 'albacore/renamer'
3
- require 'rake/renametask'
4
- require 'fail_patch'
5
-
6
- describe "when running" do
7
- before :all do
8
- rename :rename do |t|
9
- t.extend(FailPatch)
10
- @yielded_object = t
11
- end
12
- Rake::Task[:rename].invoke
13
- end
14
-
15
- it "should yield the rename api" do
16
- @yielded_object.kind_of?(Renamer).should be_true
17
- end
18
- end
19
-
20
- describe "when execution fails" do
21
- before :all do
22
- rename :rename_fail do |t|
23
- t.extend(FailPatch)
24
- t.fail
25
- end
26
- Rake::Task[:rename_fail].invoke
27
- end
28
-
29
- it "should fail the rake task" do
30
- $task_failed.should == true
31
- end
32
- end
data/spec/sftp_spec.rb DELETED
@@ -1,30 +0,0 @@
1
- require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
- require 'albacore/sftp'
3
-
4
- describe Sftp, 'when uploading files over sftp' do
5
- before :each do
6
- @sftpstub = Net::SFTP::Session.stub_instance(:upload! => nil)
7
- Net::SFTP.stub_method(:start).yields(@sftpstub)
8
-
9
- @sftp = Sftp.new
10
- @sftp.server="server"
11
- @sftp.username="user"
12
- @sftp.password="secret"
13
-
14
- @sftp.upload_files(
15
- "some.file" => "./somefolder/some.file",
16
- "another.file" => "another/folder/another.file"
17
- )
18
-
19
- @sftp.upload
20
- end
21
-
22
- it "should attempt to open a connection with the supplied connection information" do
23
- Net::SFTP.should have_received(:start).with("server", "user", :password => "secret")
24
- end
25
-
26
- it "should upload the local files to the remote destination" do
27
- @sftpstub.should have_received(:upload!).with("some.file", "./somefolder/some.file")
28
- @sftpstub.should have_received(:upload!).with("another.file", "another/folder/another.file")
29
- end
30
- end
@@ -1,42 +0,0 @@
1
- require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
- require 'albacore/sftp'
3
- require 'rake/sftptask'
4
- require 'fail_patch'
5
-
6
- describe "when running" do
7
- before :all do
8
- @sftpstub = Net::SFTP::Session.stub_instance(:upload! => nil)
9
- Net::SFTP.stub_method(:start).yields(@sftpstub)
10
- end
11
-
12
- before :each do
13
- sftp :sftp do |t|
14
- t.extend(FailPatch)
15
- @yielded_object = t
16
- end
17
- Rake::Task[:sftp].invoke
18
- end
19
-
20
- it "should yield the sftp api" do
21
- @yielded_object.kind_of?(Sftp).should == true
22
- end
23
- end
24
-
25
- describe "when execution fails" do
26
- before :all do
27
- @sftpstub = Net::SFTP::Session.stub_instance(:upload! => nil)
28
- Net::SFTP.stub_method(:start).yields(@sftpstub)
29
- end
30
-
31
- before :each do
32
- sftp :sftp_fail do |t|
33
- t.extend(FailPatch)
34
- t.fail
35
- end
36
- Rake::Task[:sftp_fail].invoke
37
- end
38
-
39
- it "should fail the rake task" do
40
- $task_failed.should be_true
41
- end
42
- end
data/spec/ssh_spec.rb DELETED
@@ -1,47 +0,0 @@
1
- require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
- require 'albacore/ssh'
3
-
4
- describe Ssh, 'when executing a command over ssh' do
5
- before :each do
6
- @sshstub = Net::SSH::Connection::Session.stub_instance(:exec! => nil)
7
- Net::SSH.stub_method(:start, &lambda{}).yields(@sshstub)
8
-
9
- @ssh = Ssh.new
10
- @ssh.server="server"
11
- @ssh.username="user"
12
- @ssh.password="secret"
13
- @ssh.commands "execute THIS!"
14
-
15
- @ssh.execute
16
- end
17
-
18
- it "should attempt to open a connection with the supplied connection information" do
19
- Net::SSH.should have_received(:start)
20
- end
21
-
22
- it "should execute the command" do
23
- @sshstub.should have_received(:exec!)
24
- end
25
- end
26
-
27
- describe Ssh, "when executing multiple commands over ssh" do
28
- before :each do
29
- @sshstub = Net::SSH::Connection::Session.stub_instance(:exec! => nil)
30
- Net::SSH.stub_method(:start, &lambda{}).yields(@sshstub)
31
-
32
- @ssh = Ssh.new
33
- @ssh.server="server"
34
- @ssh.username="user"
35
- @ssh.password="secret"
36
-
37
- @ssh.commands "execute THIS!", "another execution"
38
-
39
- @ssh.execute
40
- end
41
-
42
- it "should execute all of the specified commands" do
43
- @sshstub.should have_received(:exec!).twice
44
- end
45
-
46
- end
47
-
data/spec/sshtask_spec.rb DELETED
@@ -1,40 +0,0 @@
1
- require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
- require 'albacore/ssh'
3
- require 'rake/sshtask'
4
- require 'fail_patch'
5
-
6
- describe "when running" do
7
- before :all do
8
- Net::SSH.stub_method(:start, &lambda{}).yields(@sshstub)
9
- end
10
-
11
- before :each do
12
- ssh :ssh do |t|
13
- t.extend(FailPatch)
14
- @yielded_object = t
15
- end
16
- Rake::Task[:ssh].invoke
17
- end
18
-
19
- it "should yield the ssh api" do
20
- @yielded_object.kind_of?(Ssh).should == true
21
- end
22
- end
23
-
24
- describe "when execution fails" do
25
- before :all do
26
- Net::SSH.stub_method(:start, &lambda{}).yields(@sshstub)
27
- end
28
-
29
- before :each do
30
- ssh :ssh_fail do |t|
31
- t.extend(FailPatch)
32
- t.fail
33
- end
34
- Rake::Task[:ssh_fail].invoke
35
- end
36
-
37
- it "should fail the rake task" do
38
- $task_failed.should be_true
39
- end
40
- end
@@ -1,3 +0,0 @@
1
- a: a template file
2
- b: multiple
3
- c: values
@@ -1,11 +0,0 @@
1
- a: a template file
2
- b: multiple
3
- c: values
4
- value: 'not the right one!!!'
5
-
6
- sample-badname.config:
7
- value: 'the sample value'
8
-
9
- multipleinstance.config:
10
- value: 'the real value'
11
- b: this is a second value
@@ -1,4 +0,0 @@
1
- a: a template file
2
- b: multiple
3
- c: values
4
- value: 'the real value'
@@ -1 +0,0 @@
1
- value: 'the real value'
@@ -1,2 +0,0 @@
1
- @include: sample.yml
2
- a: data
@@ -1,5 +0,0 @@
1
- @include: template_specific_include.yml
2
-
3
- multipleinstance.config:
4
- value: 'the real value'
5
- a: data
@@ -1,3 +0,0 @@
1
- multipleinstance.config:
2
- value: 'the fake stuff goes here'
3
- b: more data
@@ -1,4 +0,0 @@
1
- first instance of '#{value}' is here.
2
- second instance of '#{value}' goes here.
3
- the value of a is #{a}
4
- b has a value of #{b}
@@ -1 +0,0 @@
1
- this is #{a} with #{b} #{c}
@@ -1 +0,0 @@
1
- this is #{value}
@@ -1,77 +0,0 @@
1
- class ExpandTemplatesTestData
2
-
3
- def initialize
4
- @rootfolder = File.join(File.dirname(__FILE__), "expandtemplates")
5
- @templatefolder = File.join(@rootfolder, "templates")
6
- @workingfolder = File.join(@rootfolder, "working")
7
- @outputfolder = File.join(@rootfolder, "output")
8
- @datafilesfolder = File.join(@rootfolder, "datafiles")
9
- create_working_folder
10
- end
11
-
12
- def create_working_folder
13
- Dir.mkdir(@workingfolder) unless File.exist?(@workingfolder)
14
- end
15
-
16
- def prep_sample_templates
17
- FileUtils.rm(Dir.glob(File.join(@workingfolder, "*")))
18
- sleep(1)
19
-
20
- Dir.glob(File.join(@templatefolder, "*")){|f|
21
- FileUtils.copy(f, @workingfolder)
22
- }
23
- end
24
-
25
- def sample_template_file
26
- File.join(@workingfolder, "sample.config")
27
- end
28
-
29
- def multipleinstance_template_file
30
- File.join(@workingfolder, "multipleinstance.config")
31
- end
32
-
33
- def sample_output_file
34
- File.join(@workingfolder, "this_is_an_output_file.config")
35
- end
36
-
37
- def multiplevalues_template_file
38
- File.join(@workingfolder, "multiplevalues.config")
39
- end
40
-
41
- def multiplevalues_output_file
42
- File.join(@workingfolder, "multiplevalues_output_file.config")
43
- end
44
-
45
- def sample_data_file
46
- File.join(@datafilesfolder, "sample.yml")
47
- end
48
-
49
- def sample_data_file_with_include
50
- File.join(@datafilesfolder, "sample_with_include.yml")
51
- end
52
-
53
- def template_specific_data_file_with_include
54
- File.join(@datafilesfolder, "template_specific_data_file_with_include.yml")
55
- end
56
-
57
- def multiplevalues_data_file
58
- File.join(@datafilesfolder, "multiplevalues.yml")
59
- end
60
-
61
- def multitemplate_data_file
62
- File.join(@datafilesfolder, "multitemplate.yml")
63
- end
64
-
65
- def multitemplate_specificfile_data_file
66
- File.join(@datafilesfolder, "multitemplate-specificfile.yml")
67
- end
68
-
69
- def read_file(file)
70
- filedata = ''
71
- File.open(file, "r") {|f|
72
- filedata = f.read
73
- }
74
- filedata
75
- end
76
-
77
- end