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.
- data/.autotest +4 -0
- data/README.markdown +1 -1
- data/VERSION +1 -1
- data/install_dependencies.rb +2 -3
- data/lib/albacore.rb +1 -0
- data/lib/albacore/albacoremodel.rb +28 -0
- data/lib/albacore/assemblyinfo.rb +5 -4
- data/lib/albacore/config/assemblyinfoconfig.rb +21 -0
- data/lib/albacore/config/config.rb +14 -0
- data/lib/albacore/config/cscconfig.rb +33 -0
- data/lib/albacore/config/docuconfig.rb +25 -0
- data/lib/albacore/config/execconfig.rb +22 -0
- data/lib/albacore/config/msbuildconfig.rb +32 -0
- data/lib/albacore/config/mspecconfig.rb +21 -0
- data/lib/albacore/config/nantconfig.rb +22 -0
- data/lib/albacore/config/ncoverconsoleconfig.rb +22 -0
- data/lib/albacore/config/ncoverreportconfig.rb +22 -0
- data/lib/albacore/config/ndependconfig.rb +22 -0
- data/lib/albacore/config/netversion.rb +23 -0
- data/lib/albacore/config/nunitconfig.rb +20 -0
- data/lib/albacore/config/specflowreportconfig.rb +27 -0
- data/lib/albacore/config/sqlcmdconfig.rb +22 -0
- data/lib/albacore/config/unzipconfig.rb +22 -0
- data/lib/albacore/config/xbuildconfig.rb +22 -0
- data/lib/albacore/config/xunitconfig.rb +22 -0
- data/lib/albacore/config/zipconfig.rb +22 -0
- data/lib/albacore/csc.rb +31 -0
- data/lib/albacore/docu.rb +8 -6
- data/lib/albacore/exec.rb +9 -3
- data/lib/albacore/msbuild.rb +5 -12
- data/lib/albacore/mspectestrunner.rb +9 -7
- data/lib/albacore/nant.rb +5 -4
- data/lib/albacore/ncoverconsole.rb +6 -9
- data/lib/albacore/ncoverreport.rb +8 -6
- data/lib/albacore/ncoverreports/codecoveragebase.rb +4 -4
- data/lib/albacore/ncoverreports/cyclomaticcomplexity.rb +4 -4
- data/lib/albacore/ncoverreports/fullcoveragereport.rb +3 -3
- data/lib/albacore/ncoverreports/reportfilterbase.rb +4 -4
- data/lib/albacore/ncoverreports/summaryreport.rb +3 -3
- data/lib/albacore/ndepend.rb +12 -9
- data/lib/albacore/nunittestrunner.rb +9 -7
- data/lib/albacore/specflowreport.rb +62 -0
- data/lib/albacore/sqlcmd.rb +8 -6
- data/lib/albacore/support/attrmethods.rb +7 -8
- data/lib/albacore/support/logging.rb +8 -4
- data/lib/albacore/support/openstruct.rb +13 -0
- data/lib/albacore/support/runcommand.rb +24 -24
- data/lib/albacore/support/supportlinux.rb +23 -0
- data/lib/albacore/support/yamlconfig.rb +2 -10
- data/lib/albacore/unzip.rb +14 -12
- data/lib/albacore/xbuild.rb +6 -5
- data/lib/albacore/xunittestrunner.rb +8 -6
- data/lib/albacore/zipdirectory.rb +27 -6
- data/lib/rake/csctask.rb +3 -0
- data/lib/rake/specflowreporttask.rb +3 -0
- data/lib/rake/unziptask.rb +1 -1
- data/rakefile.rb +21 -54
- data/spec/albacoremodel_spec.rb +35 -0
- data/spec/assemblyinfo_spec.rb +17 -0
- data/spec/attrmethods_spec.rb +17 -1
- data/spec/config_spec.rb +19 -0
- data/spec/createtask_spec.rb +45 -4
- data/spec/csc_spec.rb +87 -0
- data/spec/csctask_spec.rb +1 -0
- data/spec/docu_spec.rb +43 -1
- data/spec/exec_spec.rb +16 -1
- data/spec/msbuild_spec.rb +30 -18
- data/spec/mspec_spec.rb +28 -0
- data/spec/nant_spec.rb +20 -12
- data/spec/ncoverconsole_spec.rb +25 -13
- data/spec/ncoverreport_spec.rb +31 -18
- data/spec/ndepend_spec.rb +23 -2
- data/spec/nunittestrunner_spec.rb +48 -0
- data/spec/runcommand_spec.rb +59 -32
- data/spec/specflowreport_spec.rb +146 -0
- data/spec/specflowreporttask_spec.rb +48 -0
- data/spec/sqlcmd_spec.rb +18 -5
- data/spec/support/SpecFlow/TechTalk.SpecFlow.dll +0 -0
- data/spec/support/SpecFlow/TestSolution.SpecFlow.dll +0 -0
- data/spec/support/SpecFlow/TestSolution.SpecFlow.pdb +0 -0
- data/spec/support/SpecFlow/TestSolution.dll +0 -0
- data/spec/support/SpecFlow/TestSolution.pdb +0 -0
- data/spec/support/SpecFlow/nunit.framework.dll +0 -0
- data/spec/support/TestSolution/TestSolution.5.0.ReSharper.user +27 -0
- data/spec/support/TestSolution/TestSolution.SpecFlow/OneFeature.feature +8 -0
- data/spec/support/TestSolution/TestSolution.SpecFlow/OneFeature.feature.cs +73 -0
- data/spec/support/TestSolution/TestSolution.SpecFlow/Properties/AssemblyInfo.cs +36 -0
- data/spec/support/TestSolution/TestSolution.SpecFlow/StepDefinition.cs +30 -0
- data/spec/support/TestSolution/TestSolution.SpecFlow/TestSolution.SpecFlow.csproj +84 -0
- data/spec/support/TestSolution/TestSolution.sln +6 -0
- data/spec/support/csc/File1.cs +9 -0
- data/spec/support/csc/File2.cs +9 -0
- data/spec/support/csc/output/ignorethis.txt +1 -0
- data/spec/support/msbuildtestdata.rb +3 -3
- data/spec/support/ncoverreporttestdata.rb +2 -2
- data/spec/support/spec_helper.rb +2 -1
- data/spec/support/yamlconfig/yaml_autoconfig_test.yml +1 -1
- data/spec/unzip_spec.rb +15 -0
- data/spec/xbuild_spec.rb +15 -0
- data/spec/xunit_spec.rb +16 -2
- data/spec/yamlconfig_spec.rb +7 -6
- data/spec/zip_spec.rb +50 -9
- data/watchrtesting.rb +8 -0
- metadata +99 -91
- data/lib/albacore/expandtemplates.rb +0 -81
- data/lib/albacore/plink.rb +0 -49
- data/lib/albacore/renamer.rb +0 -17
- data/lib/albacore/sftp.rb +0 -42
- data/lib/albacore/ssh.rb +0 -44
- data/lib/albacore/support/albacore_helper.rb +0 -1
- data/lib/albacore/support/globalconfig.rb +0 -6
- data/lib/rake/expandtemplatestask.rb +0 -3
- data/lib/rake/plinktask.rb +0 -3
- data/lib/rake/renametask.rb +0 -3
- data/lib/rake/sftptask.rb +0 -3
- data/lib/rake/sshtask.rb +0 -3
- data/spec/expandtemplates_spec.rb +0 -180
- data/spec/expandtemplatestask_spec.rb +0 -46
- data/spec/plink_spec.rb +0 -62
- data/spec/plinktask_spec.rb +0 -46
- data/spec/renametask_spec.rb +0 -32
- data/spec/sftp_spec.rb +0 -30
- data/spec/sftptask_spec.rb +0 -42
- data/spec/ssh_spec.rb +0 -47
- data/spec/sshtask_spec.rb +0 -40
- data/spec/support/expandtemplates/datafiles/multiplevalues.yml +0 -3
- data/spec/support/expandtemplates/datafiles/multitemplate-specificfile.yml +0 -11
- data/spec/support/expandtemplates/datafiles/multitemplate.yml +0 -4
- data/spec/support/expandtemplates/datafiles/sample.yml +0 -1
- data/spec/support/expandtemplates/datafiles/sample_with_include.yml +0 -2
- data/spec/support/expandtemplates/datafiles/template_specific_data_file_with_include.yml +0 -5
- data/spec/support/expandtemplates/datafiles/template_specific_include.yml +0 -3
- data/spec/support/expandtemplates/templates/multipleinstance.config +0 -4
- data/spec/support/expandtemplates/templates/multiplevalues.config +0 -1
- data/spec/support/expandtemplates/templates/sample.config +0 -1
- data/spec/support/expandtemplatestestdata.rb +0 -77
data/spec/ncoverreport_spec.rb
CHANGED
@@ -22,7 +22,7 @@ describe NCoverReport, "when running a full coverage report with a specified out
|
|
22
22
|
@ncover.extend(SystemPatch)
|
23
23
|
@ncover.log_level = :verbose
|
24
24
|
|
25
|
-
@ncover.
|
25
|
+
@ncover.command = NCoverReportTestData.command
|
26
26
|
@ncover.coverage_files NCoverReportTestData.coverage_file
|
27
27
|
|
28
28
|
fullcoveragereport = NCover::FullCoverageReport.new()
|
@@ -33,7 +33,7 @@ describe NCoverReport, "when running a full coverage report with a specified out
|
|
33
33
|
end
|
34
34
|
|
35
35
|
it "should execute ncover.reporting" do
|
36
|
-
@ncover.system_command.should include(NCoverReportTestData.
|
36
|
+
@ncover.system_command.should include(NCoverReportTestData.command)
|
37
37
|
end
|
38
38
|
|
39
39
|
it "should tell ncover.reporting to produce a full coverage html report in the specified folder" do
|
@@ -53,7 +53,7 @@ describe NCoverReport, "when running a summary report with a specified output fo
|
|
53
53
|
@ncover.extend(SystemPatch)
|
54
54
|
@ncover.log_level = :verbose
|
55
55
|
|
56
|
-
@ncover.
|
56
|
+
@ncover.command = NCoverReportTestData.command
|
57
57
|
@ncover.coverage_files NCoverReportTestData.coverage_file
|
58
58
|
|
59
59
|
summaryreport = NCover::SummaryReport.new()
|
@@ -64,7 +64,7 @@ describe NCoverReport, "when running a summary report with a specified output fo
|
|
64
64
|
end
|
65
65
|
|
66
66
|
it "should execute ncover.reporting" do
|
67
|
-
@ncover.system_command.should include(NCoverReportTestData.
|
67
|
+
@ncover.system_command.should include(NCoverReportTestData.command)
|
68
68
|
end
|
69
69
|
|
70
70
|
it "should tell ncover.reporting to produce a summary html report in the specified folder" do
|
@@ -84,7 +84,7 @@ describe NCoverReport, "when running multiple ncover reports - a summary and a f
|
|
84
84
|
@ncover.extend(SystemPatch)
|
85
85
|
@ncover.log_level = :verbose
|
86
86
|
|
87
|
-
@ncover.
|
87
|
+
@ncover.command = NCoverReportTestData.command
|
88
88
|
@ncover.coverage_files NCoverReportTestData.coverage_file
|
89
89
|
|
90
90
|
summaryreport = NCover::SummaryReport.new()
|
@@ -116,7 +116,7 @@ describe NCoverReport, "when running a report with a specified minimum symbol co
|
|
116
116
|
@ncover.extend(FailPatch)
|
117
117
|
@ncover.log_level = :verbose
|
118
118
|
|
119
|
-
@ncover.
|
119
|
+
@ncover.command = NCoverReportTestData.command
|
120
120
|
@ncover.coverage_files NCoverReportTestData.coverage_file
|
121
121
|
|
122
122
|
fullcoveragereport = NCover::FullCoverageReport.new
|
@@ -152,7 +152,7 @@ describe NCoverReport, "when running a report with a specified minimum symbol co
|
|
152
152
|
@ncover.extend(FailPatch)
|
153
153
|
@ncover.log_level = :verbose
|
154
154
|
|
155
|
-
@ncover.
|
155
|
+
@ncover.command = NCoverReportTestData.command
|
156
156
|
@ncover.coverage_files NCoverReportTestData.coverage_file
|
157
157
|
|
158
158
|
fullcoveragereport = NCover::FullCoverageReport.new
|
@@ -188,7 +188,7 @@ describe NCoverReport, "when specifying the coverage item type to check" do
|
|
188
188
|
@ncover.extend(FailPatch)
|
189
189
|
@ncover.log_level = :verbose
|
190
190
|
|
191
|
-
@ncover.
|
191
|
+
@ncover.command = NCoverReportTestData.command
|
192
192
|
@ncover.coverage_files NCoverReportTestData.coverage_file
|
193
193
|
|
194
194
|
report = NCover::SummaryReport.new
|
@@ -221,7 +221,7 @@ describe NCoverReport, "when checking more than one type of coverage and all fai
|
|
221
221
|
@ncover.extend(FailPatch)
|
222
222
|
@ncover.log_level = :verbose
|
223
223
|
|
224
|
-
@ncover.
|
224
|
+
@ncover.command = NCoverReportTestData.command
|
225
225
|
@ncover.coverage_files NCoverReportTestData.coverage_file
|
226
226
|
|
227
227
|
fullcoveragereport = NCover::FullCoverageReport.new
|
@@ -267,7 +267,7 @@ describe NCoverReport, "when checking more than one type of coverage and all pas
|
|
267
267
|
@ncover.extend(FailPatch)
|
268
268
|
@ncover.log_level = :verbose
|
269
269
|
|
270
|
-
@ncover.
|
270
|
+
@ncover.command = NCoverReportTestData.command
|
271
271
|
@ncover.coverage_files NCoverReportTestData.coverage_file
|
272
272
|
|
273
273
|
fullcoveragereport = NCover::FullCoverageReport.new
|
@@ -313,7 +313,7 @@ describe NCoverReport, "when checking more than one type of coverage and one fai
|
|
313
313
|
@ncover.extend(FailPatch)
|
314
314
|
@ncover.log_level = :verbose
|
315
315
|
|
316
|
-
@ncover.
|
316
|
+
@ncover.command = NCoverReportTestData.command
|
317
317
|
@ncover.coverage_files NCoverReportTestData.coverage_file
|
318
318
|
|
319
319
|
fullcoveragereport = NCover::FullCoverageReport.new
|
@@ -354,7 +354,7 @@ describe NCoverReport, "when running a report with a cyclomatic complexity highe
|
|
354
354
|
@ncover.extend(FailPatch)
|
355
355
|
@ncover.log_level = :verbose
|
356
356
|
|
357
|
-
@ncover.
|
357
|
+
@ncover.command = NCoverReportTestData.command
|
358
358
|
@ncover.coverage_files NCoverReportTestData.coverage_file
|
359
359
|
|
360
360
|
fullcoveragereport = NCover::FullCoverageReport.new
|
@@ -389,7 +389,7 @@ describe NCoverReport, "when running a report with a cyclomatic complexity under
|
|
389
389
|
@ncover.extend(FailPatch)
|
390
390
|
@ncover.log_level = :verbose
|
391
391
|
|
392
|
-
@ncover.
|
392
|
+
@ncover.command = NCoverReportTestData.command
|
393
393
|
@ncover.coverage_files NCoverReportTestData.coverage_file
|
394
394
|
|
395
395
|
fullcoveragereport = NCover::FullCoverageReport.new
|
@@ -424,7 +424,7 @@ describe NCoverReport, "when filtering on Assembly coverage data" do
|
|
424
424
|
@ncover.extend(FailPatch)
|
425
425
|
@ncover.log_level = :verbose
|
426
426
|
|
427
|
-
@ncover.
|
427
|
+
@ncover.command = NCoverReportTestData.command
|
428
428
|
@ncover.coverage_files NCoverReportTestData.coverage_file
|
429
429
|
|
430
430
|
fullcoveragereport = NCover::FullCoverageReport.new
|
@@ -462,7 +462,7 @@ describe NCoverReport, "when filtering on Namespace coverage data" do
|
|
462
462
|
@ncover.extend(FailPatch)
|
463
463
|
@ncover.log_level = :verbose
|
464
464
|
|
465
|
-
@ncover.
|
465
|
+
@ncover.command = NCoverReportTestData.command
|
466
466
|
@ncover.coverage_files NCoverReportTestData.coverage_file
|
467
467
|
|
468
468
|
fullcoveragereport = NCover::FullCoverageReport.new
|
@@ -500,7 +500,7 @@ describe NCoverReport, "when filtering on Class coverage data" do
|
|
500
500
|
@ncover.extend(FailPatch)
|
501
501
|
@ncover.log_level = :verbose
|
502
502
|
|
503
|
-
@ncover.
|
503
|
+
@ncover.command = NCoverReportTestData.command
|
504
504
|
@ncover.coverage_files NCoverReportTestData.coverage_file
|
505
505
|
|
506
506
|
fullcoveragereport = NCover::FullCoverageReport.new
|
@@ -538,7 +538,7 @@ describe NCoverReport, "when filtering on Method coverage data" do
|
|
538
538
|
@ncover.extend(FailPatch)
|
539
539
|
@ncover.log_level = :verbose
|
540
540
|
|
541
|
-
@ncover.
|
541
|
+
@ncover.command = NCoverReportTestData.command
|
542
542
|
@ncover.coverage_files NCoverReportTestData.coverage_file
|
543
543
|
|
544
544
|
fullcoveragereport = NCover::FullCoverageReport.new
|
@@ -576,7 +576,7 @@ describe NCoverReport, "when filtering on Document coverage data" do
|
|
576
576
|
@ncover.extend(FailPatch)
|
577
577
|
@ncover.log_level = :verbose
|
578
578
|
|
579
|
-
@ncover.
|
579
|
+
@ncover.command = NCoverReportTestData.command
|
580
580
|
@ncover.coverage_files NCoverReportTestData.coverage_file
|
581
581
|
|
582
582
|
fullcoveragereport = NCover::FullCoverageReport.new
|
@@ -604,3 +604,16 @@ describe NCoverReport, "when filtering on Document coverage data" do
|
|
604
604
|
$task_failed.should be_false
|
605
605
|
end
|
606
606
|
end
|
607
|
+
|
608
|
+
describe NCoverReport, "when providing configuration values" do
|
609
|
+
let :ncoverreport do
|
610
|
+
Albacore.configure do |config|
|
611
|
+
config.ncoverreport.command = "configured"
|
612
|
+
end
|
613
|
+
ncoverreport = NCoverReport.new
|
614
|
+
end
|
615
|
+
|
616
|
+
it "should use the configured values" do
|
617
|
+
ncoverreport.command.should == "configured"
|
618
|
+
end
|
619
|
+
end
|
data/spec/ndepend_spec.rb
CHANGED
@@ -14,7 +14,7 @@ describe "when executing Ndepend console" do
|
|
14
14
|
@ndepend = NDepend.new
|
15
15
|
@ndepend.log_device = StringIO.new
|
16
16
|
@ndepend.project_file = "spec/support/TestSolution/NDependProject.xml"
|
17
|
-
@ndepend.
|
17
|
+
@ndepend.command = "spec/support/tools/Ndepend-v2.12/NDepend.Console.exe"
|
18
18
|
|
19
19
|
@logger = StringIO.new
|
20
20
|
@ndepend.log_device = @logger
|
@@ -48,4 +48,25 @@ describe "when executing Ndepend console" do
|
|
48
48
|
@ndepend.run
|
49
49
|
@log_data.should include(expected_params)
|
50
50
|
end
|
51
|
-
|
51
|
+
|
52
|
+
it "should order command line properly by including ndepend project file first" do
|
53
|
+
expected_params = "/Help"
|
54
|
+
@ndepend.parameters expected_params
|
55
|
+
@ndepend.extend(FailPatch)
|
56
|
+
@ndepend.run
|
57
|
+
@log_data.should =~ /.*NDepend.Console.exe.*NDependProject.xml.*Help.*/
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
describe NDepend, "when providing configuration" do
|
62
|
+
let :ndepend do
|
63
|
+
Albacore.configure do |config|
|
64
|
+
config.ndepend.command = "configured"
|
65
|
+
end
|
66
|
+
ndepend = NDepend.new
|
67
|
+
end
|
68
|
+
|
69
|
+
it "should use the configured values" do
|
70
|
+
ndepend.command.should == "configured"
|
71
|
+
end
|
72
|
+
end
|
@@ -72,3 +72,51 @@ describe NUnitTestRunner, "when configured correctly" do
|
|
72
72
|
$task_failed.should be_false
|
73
73
|
end
|
74
74
|
end
|
75
|
+
|
76
|
+
describe NUnitTestRunner, "when using the configuration command and not providing a command in the intializer" do
|
77
|
+
it_should_behave_like "nunit paths"
|
78
|
+
|
79
|
+
before :all do
|
80
|
+
Albacore.configure do |config|
|
81
|
+
config.nunit.command = "configured command"
|
82
|
+
end
|
83
|
+
@nunit = NUnitTestRunner.new
|
84
|
+
end
|
85
|
+
|
86
|
+
it "should use the configuration command" do
|
87
|
+
@nunit.command.should == "configured command"
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
describe NUnitTestRunner, "when the command has been set through configuration and providing a command in the intializer" do
|
92
|
+
it_should_behave_like "nunit paths"
|
93
|
+
|
94
|
+
before :all do
|
95
|
+
Albacore.configure do |config|
|
96
|
+
config.nunit.command = "configured command"
|
97
|
+
end
|
98
|
+
@nunit = NUnitTestRunner.new("initializer command")
|
99
|
+
end
|
100
|
+
|
101
|
+
it "should use the initializer command" do
|
102
|
+
@nunit.command.should == "initializer command"
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
describe NUnitTestRunner, "when configuration has been provided" do
|
107
|
+
before :all do
|
108
|
+
Albacore.configure do |config|
|
109
|
+
config.nunit do |nunit|
|
110
|
+
nunit.assemblies = ["foo.dll", "bar.dll"]
|
111
|
+
nunit.options = ["/noshadow"]
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
@nunit = NUnitTestRunner.new
|
116
|
+
end
|
117
|
+
|
118
|
+
it "should use the provided configuration" do
|
119
|
+
@nunit.assemblies.should == ["foo.dll", "bar.dll"]
|
120
|
+
@nunit.options.should == ["/noshadow"]
|
121
|
+
end
|
122
|
+
end
|
data/spec/runcommand_spec.rb
CHANGED
@@ -1,48 +1,75 @@
|
|
1
1
|
require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
|
2
|
-
require 'albacore/
|
2
|
+
require 'albacore/albacoremodel'
|
3
3
|
require 'system_patch'
|
4
4
|
|
5
5
|
class RunCommandObject
|
6
|
-
include
|
6
|
+
include AlbacoreModel
|
7
7
|
include RunCommand
|
8
8
|
|
9
9
|
def execute
|
10
|
-
@require_valid_command = false
|
11
10
|
result = run_command "Run Command Test Object"
|
12
11
|
end
|
13
12
|
end
|
14
13
|
|
15
|
-
describe "when
|
14
|
+
describe "when setting the command" do
|
16
15
|
before :all do
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
16
|
+
@runme = RunCommandObject.new
|
17
|
+
@runme.extend SystemPatch
|
18
|
+
|
19
|
+
@runme.command = "test.exe"
|
20
|
+
@runme.execute
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should execute the specified command, quoted" do
|
24
|
+
@runme.system_command.should == "\"test.exe\""
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe "when specifying a parmaeter to a command" do
|
29
|
+
before :all do
|
30
|
+
@runme = RunCommandObject.new
|
31
|
+
@runme.extend SystemPatch
|
32
|
+
@runme.command = "test.exe"
|
33
|
+
@runme.parameters "param1"
|
34
|
+
@runme.execute
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should separate the parameters from the command" do
|
38
|
+
@runme.system_command.should == "\"test.exe\" param1"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
describe "when specifying multiple parameters to a command" do
|
43
|
+
before :all do
|
44
|
+
@runme = RunCommandObject.new
|
45
|
+
@runme.extend SystemPatch
|
46
|
+
@runme.command = "test.exe"
|
47
|
+
@runme.parameters "param1", "param2", "param3"
|
48
|
+
@runme.execute
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should separate all parameters by a space" do
|
52
|
+
@runme.system_command.should == "\"test.exe\" param1 param2 param3"
|
45
53
|
end
|
46
54
|
end
|
47
55
|
|
56
|
+
describe "when executing a runcommand object twice" do
|
57
|
+
before :all do
|
58
|
+
@runmeone = RunCommandObject.new
|
59
|
+
@runmetwo = @runmeone
|
60
|
+
@runmeone.extend SystemPatch
|
61
|
+
@runmeone.command = "test.exe"
|
62
|
+
@runmeone.parameters "1", "2", "3"
|
48
63
|
|
64
|
+
@runmeone.execute
|
65
|
+
@runmetwo.execute
|
66
|
+
end
|
67
|
+
|
68
|
+
it "should only pass the parameters to the command once for the first execution" do
|
69
|
+
@runmeone.system_command.should == "\"test.exe\" 1 2 3"
|
70
|
+
end
|
71
|
+
|
72
|
+
it "should only pass the parameters to the command once for the second execution" do
|
73
|
+
@runmetwo.system_command.should == "\"test.exe\" 1 2 3"
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,146 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
|
2
|
+
require 'albacore/specflowreport'
|
3
|
+
require 'albacore/nunittestrunner'
|
4
|
+
|
5
|
+
shared_examples_for "specflow paths" do
|
6
|
+
before :all do
|
7
|
+
@specflowpath = File.join(File.dirname(__FILE__), 'support', 'Tools', 'SpecFlow', 'specflow.exe')
|
8
|
+
@test_project = File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'TestSolution', 'TestSolution.SpecFlow', 'TestSolution.SpecFlow.csproj')
|
9
|
+
@nunit_test_restuls = "/xmlTestResult:TestResult.xml"
|
10
|
+
@output_option = "/out:specs.html"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
describe SpecFlowReport, "when running without specifying command path" do
|
15
|
+
it_should_behave_like "specflow paths"
|
16
|
+
|
17
|
+
before :all do
|
18
|
+
@spec = SpecFlowReport.new()
|
19
|
+
@spec.projects @test_project
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should try to run in same folder" do
|
23
|
+
@spec.command.should eql('specflow.exe')
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
describe SpecFlowReport, "When not passing a project" do
|
28
|
+
|
29
|
+
before :all do
|
30
|
+
@spec = SpecFlowReport.new()
|
31
|
+
@spec.extend(FailPatch)
|
32
|
+
@spec.execute
|
33
|
+
$task_failed.should be_true
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should fail" do
|
37
|
+
$task_failed.should be_true
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe SpecFlowReport, "When passing a command" do
|
42
|
+
it_should_behave_like "specflow paths"
|
43
|
+
|
44
|
+
before :all do
|
45
|
+
@spec = SpecFlowReport.new("/path_to_command/")
|
46
|
+
@spec.projects @test_project
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should not include specflow.exe" do
|
50
|
+
@spec.command.should eql('/path_to_command/')
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
describe SpecFlowReport, "When passing some options" do
|
55
|
+
it_should_behave_like "specflow paths"
|
56
|
+
before :all do
|
57
|
+
spec = SpecFlowReport.new()
|
58
|
+
spec.options @output_option
|
59
|
+
spec.projects @test_project
|
60
|
+
@command_line = spec.get_command_line
|
61
|
+
end
|
62
|
+
|
63
|
+
it "should include the options in the command line" do
|
64
|
+
@command_line.should include(@output_option)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
describe SpecFlowReport, "When no options are passed" do
|
69
|
+
it_should_behave_like "specflow paths"
|
70
|
+
|
71
|
+
before :all do
|
72
|
+
spec = SpecFlowReport.new()
|
73
|
+
spec.projects @test_project
|
74
|
+
@command_line = spec.get_command_line
|
75
|
+
end
|
76
|
+
|
77
|
+
it "should include sensible defaults" do
|
78
|
+
@command_line.should include("/xmlTestResult:TestResult.xml /out:specs.html")
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
describe SpecFlowReport, "When a report is specified" do
|
83
|
+
it_should_behave_like "specflow paths"
|
84
|
+
before :all do
|
85
|
+
@spec = SpecFlowReport.new()
|
86
|
+
@spec.report = 'assigned report'
|
87
|
+
@spec.projects @test_project
|
88
|
+
end
|
89
|
+
|
90
|
+
it "should include the specified report in the command line" do
|
91
|
+
@spec.get_command_line.should include("assigned report")
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
describe SpecFlowReport, "When no report is specified" do
|
96
|
+
it_should_behave_like "specflow paths"
|
97
|
+
before :all do
|
98
|
+
@spec = SpecFlowReport.new()
|
99
|
+
@spec.projects @test_project
|
100
|
+
end
|
101
|
+
|
102
|
+
it "should include the nunit report in the command line" do
|
103
|
+
@spec.get_command_line.should include("nunitexecutionreport")
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
describe SpecFlowReport, "when configured correctly" do
|
108
|
+
it_should_behave_like "specflow paths"
|
109
|
+
|
110
|
+
before :all do
|
111
|
+
nunitpath = File.join(File.dirname(__FILE__), 'support', 'Tools', 'NUnit-v2.5', 'nunit-console-x86.exe')
|
112
|
+
test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'SpecFlow', 'TestSolution.SpecFlow.dll')
|
113
|
+
|
114
|
+
nunit = NUnitTestRunner.new(nunitpath)
|
115
|
+
nunit.extend(FailPatch)
|
116
|
+
nunit.assemblies test_assembly
|
117
|
+
nunit.options '/noshadow /out=TestResult.xml'
|
118
|
+
nunit.execute
|
119
|
+
|
120
|
+
spec = SpecFlowReport.new(@specflowpath)
|
121
|
+
spec.extend(FailPatch)
|
122
|
+
spec.projects @test_project
|
123
|
+
|
124
|
+
spec.execute
|
125
|
+
end
|
126
|
+
|
127
|
+
it "should execute" do
|
128
|
+
$task_failed.should be_false
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
describe SpecFlowReport, "when providing configuration" do
|
133
|
+
let :specflow do
|
134
|
+
Albacore.configure do |config|
|
135
|
+
config.specflowreport.command = "configured"
|
136
|
+
config.specflowreport.report = "configured report"
|
137
|
+
end
|
138
|
+
specflow = SpecFlowReport.new
|
139
|
+
end
|
140
|
+
|
141
|
+
it "should use the configured values" do
|
142
|
+
specflow.command.should == "configured"
|
143
|
+
specflow.report.should == "configured report"
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|