albacore 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. data/README.markdown +17 -7
  2. data/VERSION +1 -1
  3. data/install_dependencies.rb +46 -0
  4. data/lib/albacore.rb +1 -0
  5. data/lib/albacore/command.rb +23 -0
  6. data/lib/albacore/expandtemplates.rb +19 -4
  7. data/lib/albacore/msbuild.rb +3 -0
  8. data/lib/albacore/mspectestrunner.rb +22 -8
  9. data/lib/albacore/nunittestrunner.rb +5 -4
  10. data/lib/albacore/sftp.rb +19 -3
  11. data/lib/albacore/ssh.rb +20 -3
  12. data/lib/albacore/xunittestrunner.rb +48 -0
  13. data/lib/albacore/zipdirectory.rb +33 -12
  14. data/lib/rake/assemblyinfotask.rb +9 -15
  15. data/lib/rake/commandtask.rb +16 -0
  16. data/lib/rake/expandtemplatestask.rb +8 -14
  17. data/lib/rake/msbuildtask.rb +10 -15
  18. data/lib/rake/mspectask.rb +16 -0
  19. data/lib/rake/ncoverconsoletask.rb +9 -15
  20. data/lib/rake/ncoverreporttask.rb +9 -15
  21. data/lib/rake/nunittask.rb +9 -15
  22. data/lib/rake/renametask.rb +11 -16
  23. data/lib/rake/sftptask.rb +8 -14
  24. data/lib/rake/sqlcmdtask.rb +9 -15
  25. data/lib/rake/sshtask.rb +8 -14
  26. data/lib/rake/support/albacoretask.rb +19 -0
  27. data/lib/rake/xunittask.rb +16 -0
  28. data/lib/rake/ziptask.rb +9 -14
  29. data/rakefile.rb +95 -11
  30. data/spec/command_spec.rb +23 -0
  31. data/spec/commandtask_spec.rb +31 -0
  32. data/spec/expandtemplates_spec.rb +52 -0
  33. data/spec/expandtemplatestask_spec.rb +1 -1
  34. data/spec/msbuild_spec.rb +5 -5
  35. data/spec/msbuildtask_spec.rb +1 -1
  36. data/spec/mspectask_spec.rb +31 -0
  37. data/spec/ncoverconsole_spec.rb +43 -43
  38. data/spec/ncoverconsoletask_spec.rb +1 -1
  39. data/spec/ncoverreport_spec.rb +51 -51
  40. data/spec/ncoverreporttask_spec.rb +1 -1
  41. data/spec/nunittask_spec.rb +1 -1
  42. data/spec/nunittestrunner_spec.rb +64 -0
  43. data/spec/patches/system_patch.rb +5 -1
  44. data/spec/renametask_spec.rb +1 -1
  45. data/spec/sftptask_spec.rb +1 -1
  46. data/spec/sqlcmd_spec.rb +39 -39
  47. data/spec/sqlcmdtask_spec.rb +1 -1
  48. data/spec/sshtask_spec.rb +1 -1
  49. data/spec/support/CodeCoverage/xunit/assemblies/TestSolution.XUnitTests.dll +0 -0
  50. data/spec/support/CodeCoverage/xunit/assemblies/TestSolution.dll +0 -0
  51. data/spec/support/CodeCoverage/xunit/assemblies/xunit.dll +0 -0
  52. data/spec/support/CodeCoverage/xunit/assemblies/xunit.xml +2306 -0
  53. data/spec/support/TestSolution/TestSolution.XUnitTests/Class1.cs +19 -0
  54. data/spec/support/TestSolution/TestSolution.XUnitTests/Properties/AssemblyInfo.cs +36 -0
  55. data/spec/support/TestSolution/TestSolution.XUnitTests/TestSolution.XUnitTests.csproj +69 -0
  56. data/spec/support/TestSolution/TestSolution.sln +6 -0
  57. data/spec/support/expandtemplates/datafiles/sample_with_include.yml +2 -0
  58. data/spec/support/expandtemplates/datafiles/template_specific_data_file_with_include.yml +5 -0
  59. data/spec/support/expandtemplates/datafiles/template_specific_include.yml +3 -0
  60. data/spec/support/expandtemplatestestdata.rb +8 -0
  61. data/spec/support/spec_helper.rb +2 -0
  62. data/spec/xunittask_spec.rb +31 -0
  63. data/spec/zip_spec.rb +3 -3
  64. data/spec/ziptask_spec.rb +2 -1
  65. metadata +42 -4
@@ -0,0 +1,23 @@
1
+ require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
+ require 'albacore/command'
3
+
4
+ @@nunit = File.join(File.dirname(__FILE__), 'support', 'Tools', 'NUnit-v2.5', 'nunit-console-x86.exe')
5
+
6
+ describe Command, "when executing a command with parameters" do
7
+ before :all do
8
+ @cmd = Command.new
9
+ @cmd.log_level = :verbose
10
+ @cmd.extend(SystemPatch)
11
+ @cmd.path_to_command = @@nunit
12
+ @cmd.parameters << ["--help"]
13
+ @cmd.execute
14
+ end
15
+
16
+ it "should run the command with the parameters" do
17
+ @cmd.system_command.should include("\"#{@@nunit}\" --help")
18
+ end
19
+
20
+ it "should not fail" do
21
+ @cmd.failed.should be_false
22
+ end
23
+ end
@@ -0,0 +1,31 @@
1
+ require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
+ require 'albacore/command'
3
+ require 'rake/commandtask'
4
+ require 'tasklib_patch'
5
+
6
+ describe Albacore::CommandTask, "when running" do
7
+ before :all do
8
+ task = Albacore::CommandTask.new(:command) do |t|
9
+ @yielded_object = t
10
+ end
11
+ task.extend(TasklibPatch)
12
+ Rake::Task[:command].invoke
13
+ end
14
+
15
+ it "should yield the command api" do
16
+ @yielded_object.kind_of?(Command).should == true
17
+ end
18
+ end
19
+
20
+ describe Albacore::CommandTask, "when execution fails" do
21
+ before :all do
22
+ @task = Albacore::CommandTask.new(:failingtask)
23
+ @task.extend(TasklibPatch)
24
+ @task.fail
25
+ Rake::Task["failingtask"].invoke
26
+ end
27
+
28
+ it "should fail the rake task" do
29
+ @task.task_failed.should be_true
30
+ end
31
+ end
@@ -125,3 +125,55 @@ describe ExpandTemplates, "when expanding template files and the data file conta
125
125
  @sample_file_data.should include("this is not the right one!!!")
126
126
  end
127
127
  end
128
+
129
+ describe ExpandTemplates, "when including external data and specified placeholder is not found in local data" do
130
+ it_should_behave_like "prepping the sample templates"
131
+
132
+ before :all do
133
+ @templates.expand_files = {@testdata.multipleinstance_template_file => @testdata.multipleinstance_template_file}
134
+ @templates.data_file = @testdata.sample_data_file_with_include
135
+ @templates.expand
136
+
137
+ @output_file_data = @testdata.read_file(@testdata.multipleinstance_template_file)
138
+ end
139
+
140
+ it "should use data from the included file" do
141
+ @output_file_data.should include("first instance of 'the real value' is here.")
142
+ end
143
+ end
144
+
145
+ describe ExpandTemplates, "when including external data and specified placeholder is found in local data" do
146
+ it_should_behave_like "prepping the sample templates"
147
+
148
+ before :all do
149
+ @templates.expand_files = {@testdata.multipleinstance_template_file => @testdata.multipleinstance_template_file}
150
+ @templates.data_file = @testdata.sample_data_file_with_include
151
+ @templates.expand
152
+
153
+ @output_file_data = @testdata.read_file(@testdata.multipleinstance_template_file)
154
+ end
155
+
156
+ it "should use data from the local file" do
157
+ @output_file_data.should include("the value of a is data")
158
+ end
159
+ end
160
+
161
+ describe ExpandTemplates, "when when external data includes at least part of the data for a specific template" do
162
+ it_should_behave_like "prepping the sample templates"
163
+
164
+ before :all do
165
+ @templates.expand_files = {@testdata.multipleinstance_template_file => @testdata.multipleinstance_template_file}
166
+ @templates.data_file = @testdata.template_specific_data_file_with_include
167
+ @templates.expand
168
+
169
+ @output_file_data = @testdata.read_file(@testdata.multipleinstance_template_file)
170
+ end
171
+
172
+ it "should use the external data that was supplied" do
173
+ @output_file_data.should include("the value of a is data")
174
+ end
175
+
176
+ it "should override the external data with template specific data from the local file" do
177
+ @output_file_data.should include("first instance of 'the real value' is here.")
178
+ end
179
+ end
@@ -5,7 +5,7 @@ require 'tasklib_patch'
5
5
 
6
6
  describe Albacore::ExpandTemplatesTask, "when running" do
7
7
  before :each do
8
- task = Albacore::ExpandTemplatesTask.new() do |t|
8
+ task = Albacore::ExpandTemplatesTask.new(:expandtemplates) do |t|
9
9
  @yielded_object = t
10
10
  end
11
11
  task.extend(TasklibPatch)
@@ -105,7 +105,7 @@ describe MSBuild, "when building a visual studio solution for a specified config
105
105
  end
106
106
 
107
107
  it "should build with the specified configuration as a property" do
108
- $system_command.should include("/p:configuration=\"Release\"")
108
+ @msbuild.system_command.should include("/p:configuration=\"Release\"")
109
109
  end
110
110
 
111
111
  it "should output the solution's binaries according to the specified configuration" do
@@ -125,7 +125,7 @@ describe MSBuild, "when specifying targets to build" do
125
125
  end
126
126
 
127
127
  it "should build the targets" do
128
- $system_command.should include("/target:Clean;Build")
128
+ @msbuild.system_command.should include("/target:Clean;Build")
129
129
  end
130
130
 
131
131
  end
@@ -141,7 +141,7 @@ describe MSBuild, "when building a solution with a specific msbuild verbosity" d
141
141
  end
142
142
 
143
143
  it "should call msbuild with the specified verbosity" do
144
- $system_command.should include("/verbosity:normal")
144
+ @msbuild.system_command.should include("/verbosity:normal")
145
145
  end
146
146
  end
147
147
 
@@ -159,11 +159,11 @@ describe MSBuild, "when specifying multiple configuration properties" do
159
159
  end
160
160
 
161
161
  it "should specify the first property" do
162
- $system_command.should include("/p:configuration=\"Debug\"")
162
+ @msbuild.system_command.should include("/p:configuration=\"Debug\"")
163
163
  end
164
164
 
165
165
  it "should specifiy the second property" do
166
- $system_command.should include("/p:DebugSymbols=\"true\"")
166
+ @msbuild.system_command.should include("/p:DebugSymbols=\"true\"")
167
167
  end
168
168
 
169
169
  it "should output the solution's binaries" do
@@ -5,7 +5,7 @@ require 'tasklib_patch'
5
5
 
6
6
  describe Albacore::MSBuildTask, "when running" do
7
7
  before :all do
8
- task = Albacore::MSBuildTask.new() do |t|
8
+ task = Albacore::MSBuildTask.new(:msbuild) do |t|
9
9
  @yielded_object = t
10
10
  end
11
11
  task.extend(TasklibPatch)
@@ -0,0 +1,31 @@
1
+ require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
2
+ require 'albacore/mspectestrunner'
3
+ require 'rake/mspectask'
4
+ require 'tasklib_patch'
5
+
6
+ describe Albacore::MSpecTask, "when running" do
7
+ before :all do
8
+ task = Albacore::MSpecTask.new(:mspec) do |t|
9
+ @yielded_object = t
10
+ end
11
+ task.extend(TasklibPatch)
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 Albacore::MSpecTask, "when execution fails" do
21
+ before :all do
22
+ @task = Albacore::MSpecTask.new(:failingtask)
23
+ @task.extend(TasklibPatch)
24
+ @task.fail
25
+ Rake::Task["failingtask"].invoke
26
+ end
27
+
28
+ it "should fail the rake task" do
29
+ @task.task_failed.should == true
30
+ end
31
+ end
@@ -19,51 +19,51 @@ describe NCoverConsole, "when specifying aseemblies to cover" do
19
19
  before :all do
20
20
  File.delete(@@xml_coverage_output) if File.exist?(@@xml_coverage_output)
21
21
 
22
- ncc = NCoverConsole.new()
22
+ @ncc = NCoverConsole.new()
23
23
 
24
- ncc.extend(SystemPatch)
25
- ncc.log_level = :verbose
26
- ncc.path_to_command = @@ncoverpath
27
- ncc.output = {:xml => @@xml_coverage_output}
28
- ncc.working_directory = @@working_directory
29
- ncc.cover_assemblies << "TestSolution"
24
+ @ncc.extend(SystemPatch)
25
+ @ncc.log_level = :verbose
26
+ @ncc.path_to_command = @@ncoverpath
27
+ @ncc.output = {:xml => @@xml_coverage_output}
28
+ @ncc.working_directory = @@working_directory
29
+ @ncc.cover_assemblies << "TestSolution"
30
30
 
31
31
  nunit = NUnitTestRunner.new(@@nunitpath)
32
32
  nunit.assemblies << @@test_assembly
33
33
  nunit.options << '/noshadow'
34
34
 
35
- ncc.testrunner = nunit
36
- ncc.run
35
+ @ncc.testrunner = nunit
36
+ @ncc.run
37
37
  end
38
38
 
39
39
  it "should provide coverage for the specified assemblies" do
40
- $system_command.should include("//assemblies \"TestSolution\"")
40
+ @ncc.system_command.should include("//assemblies \"TestSolution\"")
41
41
  end
42
42
  end
43
43
 
44
- describe NCoverConsole, "when specifying aseemblies to ignore" do
44
+ describe NCoverConsole, "when specifying assemblies to ignore" do
45
45
  before :all do
46
46
  File.delete(@@xml_coverage_output) if File.exist?(@@xml_coverage_output)
47
47
 
48
- ncc = NCoverConsole.new()
48
+ @ncc = NCoverConsole.new()
49
49
 
50
- ncc.extend(SystemPatch)
51
- ncc.log_level = :verbose
52
- ncc.path_to_command = @@ncoverpath
53
- ncc.output = {:xml => @@xml_coverage_output}
54
- ncc.working_directory = @@working_directory
55
- ncc.ignore_assemblies << "TestSolution.*"
50
+ @ncc.extend(SystemPatch)
51
+ @ncc.log_level = :verbose
52
+ @ncc.path_to_command = @@ncoverpath
53
+ @ncc.output = {:xml => @@xml_coverage_output}
54
+ @ncc.working_directory = @@working_directory
55
+ @ncc.ignore_assemblies << "TestSolution.*"
56
56
 
57
57
  nunit = NUnitTestRunner.new(@@nunitpath)
58
58
  nunit.assemblies << @@test_assembly
59
59
  nunit.options << '/noshadow'
60
60
 
61
- ncc.testrunner = nunit
62
- ncc.run
61
+ @ncc.testrunner = nunit
62
+ @ncc.run
63
63
  end
64
64
 
65
65
  it "should provide coverage for the specified assemblies" do
66
- $system_command.should include("//exclude-assemblies \"TestSolution.*\"")
66
+ @ncc.system_command.should include("//exclude-assemblies \"TestSolution.*\"")
67
67
  end
68
68
  end
69
69
 
@@ -71,25 +71,25 @@ describe NCoverConsole, "when specifying the types of coverage to analyze" do
71
71
  before :all do
72
72
  File.delete(@@xml_coverage_output) if File.exist?(@@xml_coverage_output)
73
73
 
74
- ncc = NCoverConsole.new()
74
+ @ncc = NCoverConsole.new()
75
75
 
76
- ncc.extend(SystemPatch)
77
- ncc.log_level = :verbose
78
- ncc.path_to_command = @@ncoverpath
79
- ncc.output = {:xml => @@xml_coverage_output}
80
- ncc.working_directory = @@working_directory
81
- ncc.coverage = [:Symbol, :Branch, :MethodVisits, :CyclomaticComplexity]
76
+ @ncc.extend(SystemPatch)
77
+ @ncc.log_level = :verbose
78
+ @ncc.path_to_command = @@ncoverpath
79
+ @ncc.output = {:xml => @@xml_coverage_output}
80
+ @ncc.working_directory = @@working_directory
81
+ @ncc.coverage = [:Symbol, :Branch, :MethodVisits, :CyclomaticComplexity]
82
82
 
83
83
  nunit = NUnitTestRunner.new(@@nunitpath)
84
84
  nunit.assemblies << @@test_assembly
85
85
  nunit.options << '/noshadow'
86
86
 
87
- ncc.testrunner = nunit
88
- ncc.run
87
+ @ncc.testrunner = nunit
88
+ @ncc.run
89
89
  end
90
90
 
91
91
  it "should only run coverage for those metrics" do
92
- $system_command.should include("//coverage-type \"Symbol, Branch, MethodVisits, CyclomaticComplexity\"")
92
+ @ncc.system_command.should include("//coverage-type \"Symbol, Branch, MethodVisits, CyclomaticComplexity\"")
93
93
  end
94
94
  end
95
95
 
@@ -150,36 +150,36 @@ describe NCoverConsole, "when producing an xml coverage report with nunit" do
150
150
  before :all do
151
151
  File.delete(@@xml_coverage_output) if File.exist?(@@xml_coverage_output)
152
152
 
153
- ncc = NCoverConsole.new()
153
+ @ncc = NCoverConsole.new()
154
154
 
155
- ncc.extend(SystemPatch)
156
- ncc.log_level = :verbose
157
- ncc.path_to_command = @@ncoverpath
158
- ncc.output = {:xml => @@xml_coverage_output}
159
- ncc.working_directory = @@working_directory
155
+ @ncc.extend(SystemPatch)
156
+ @ncc.log_level = :verbose
157
+ @ncc.path_to_command = @@ncoverpath
158
+ @ncc.output = {:xml => @@xml_coverage_output}
159
+ @ncc.working_directory = @@working_directory
160
160
 
161
161
  nunit = NUnitTestRunner.new(@@nunitpath)
162
162
  nunit.assemblies << @@test_assembly
163
163
  nunit.options << '/noshadow'
164
164
 
165
- ncc.testrunner = nunit
166
- ncc.run
165
+ @ncc.testrunner = nunit
166
+ @ncc.run
167
167
  end
168
168
 
169
169
  it "should execute ncover.console from the specified path" do
170
- $system_command.should include(@@ncoverpath)
170
+ @ncc.system_command.should include(@@ncoverpath)
171
171
  end
172
172
 
173
173
  it "should execute with the specified working directory" do
174
- $system_command.should include(@@working_directory)
174
+ @ncc.system_command.should include(@@working_directory)
175
175
  end
176
176
 
177
177
  it "should execute the test runner from the specified path" do
178
- $system_command.should include(@@nunitpath)
178
+ @ncc.system_command.should include(@@nunitpath)
179
179
  end
180
180
 
181
181
  it "should pass the specified arguments to the test runner" do
182
- $system_command.should include("TestSolution.Tests.dll /noshadow")
182
+ @ncc.system_command.should include("TestSolution.Tests.dll /noshadow")
183
183
  end
184
184
 
185
185
  it "should write the coverage data to the specified file" do
@@ -5,7 +5,7 @@ require 'tasklib_patch'
5
5
 
6
6
  describe Albacore::NCoverConsoleTask, "when running" do
7
7
  before :all do
8
- task = Albacore::NCoverConsoleTask.new() do |t|
8
+ task = Albacore::NCoverConsoleTask.new(:ncoverconsole) do |t|
9
9
  @yielded_object = t
10
10
  end
11
11
  task.extend(TasklibPatch)
@@ -17,26 +17,26 @@ describe NCoverReport, "when running a full coverage report with a specified out
17
17
  before :all do
18
18
  NCoverReportTestData.clean_output_folder
19
19
 
20
- ncover = NCoverReport.new
21
- ncover.extend(SystemPatch)
22
- ncover.log_level = :verbose
20
+ @ncover = NCoverReport.new
21
+ @ncover.extend(SystemPatch)
22
+ @ncover.log_level = :verbose
23
23
 
24
- ncover.path_to_command = NCoverReportTestData.path_to_command
25
- ncover.coverage_files << NCoverReportTestData.coverage_file
24
+ @ncover.path_to_command = NCoverReportTestData.path_to_command
25
+ @ncover.coverage_files << NCoverReportTestData.coverage_file
26
26
 
27
27
  fullcoveragereport = NCover::FullCoverageReport.new()
28
28
  fullcoveragereport.output_path = NCoverReportTestData.output_folder
29
- ncover.reports << fullcoveragereport
29
+ @ncover.reports << fullcoveragereport
30
30
 
31
- ncover.run
31
+ @ncover.run
32
32
  end
33
33
 
34
34
  it "should execute ncover.reporting" do
35
- $system_command.should include(NCoverReportTestData.path_to_command)
35
+ @ncover.system_command.should include(NCoverReportTestData.path_to_command)
36
36
  end
37
37
 
38
38
  it "should tell ncover.reporting to produce a full coverage html report in the specified folder" do
39
- $system_command.should include("//or FullCoverageReport:Html:\"#{NCoverReportTestData.output_folder}\"")
39
+ @ncover.system_command.should include("//or FullCoverageReport:Html:\"#{NCoverReportTestData.output_folder}\"")
40
40
  end
41
41
 
42
42
  it "should produce the report" do
@@ -48,26 +48,26 @@ describe NCoverReport, "when running a summary report with a specified output fo
48
48
  before :all do
49
49
  NCoverReportTestData.clean_output_folder
50
50
 
51
- ncover = NCoverReport.new
52
- ncover.extend(SystemPatch)
53
- ncover.log_level = :verbose
51
+ @ncover = NCoverReport.new
52
+ @ncover.extend(SystemPatch)
53
+ @ncover.log_level = :verbose
54
54
 
55
- ncover.path_to_command = NCoverReportTestData.path_to_command
56
- ncover.coverage_files << NCoverReportTestData.coverage_file
55
+ @ncover.path_to_command = NCoverReportTestData.path_to_command
56
+ @ncover.coverage_files << NCoverReportTestData.coverage_file
57
57
 
58
58
  summaryreport = NCover::SummaryReport.new()
59
59
  summaryreport.output_path = NCoverReportTestData.summary_output_file
60
- ncover.reports << summaryreport
60
+ @ncover.reports << summaryreport
61
61
 
62
- ncover.run
62
+ @ncover.run
63
63
  end
64
64
 
65
65
  it "should execute ncover.reporting" do
66
- $system_command.should include(NCoverReportTestData.path_to_command)
66
+ @ncover.system_command.should include(NCoverReportTestData.path_to_command)
67
67
  end
68
68
 
69
69
  it "should tell ncover.reporting to produce a summary html report in the specified folder" do
70
- $system_command.should include("//or Summary:Html:\"#{NCoverReportTestData.summary_output_file}\"")
70
+ @ncover.system_command.should include("//or Summary:Html:\"#{NCoverReportTestData.summary_output_file}\"")
71
71
  end
72
72
 
73
73
  it "should produce the report" do
@@ -79,31 +79,31 @@ describe NCoverReport, "when running multiple ncover reports - a summary and a f
79
79
  before :all do
80
80
  NCoverReportTestData.clean_output_folder
81
81
 
82
- ncover = NCoverReport.new
83
- ncover.extend(SystemPatch)
84
- ncover.log_level = :verbose
82
+ @ncover = NCoverReport.new
83
+ @ncover.extend(SystemPatch)
84
+ @ncover.log_level = :verbose
85
85
 
86
- ncover.path_to_command = NCoverReportTestData.path_to_command
87
- ncover.coverage_files << NCoverReportTestData.coverage_file
86
+ @ncover.path_to_command = NCoverReportTestData.path_to_command
87
+ @ncover.coverage_files << NCoverReportTestData.coverage_file
88
88
 
89
89
  summaryreport = NCover::SummaryReport.new()
90
90
  summaryreport.output_path = NCoverReportTestData.summary_output_file
91
- ncover.reports << summaryreport
91
+ @ncover.reports << summaryreport
92
92
 
93
93
  fullcoveragereport = NCover::FullCoverageReport.new()
94
94
  @fullcoverage_output_folder = File.join(NCoverReportTestData.output_folder, "fullcoverage")
95
95
  fullcoveragereport.output_path = @fullcoverage_output_folder
96
- ncover.reports << fullcoveragereport
96
+ @ncover.reports << fullcoveragereport
97
97
 
98
- ncover.run
98
+ @ncover.run
99
99
  end
100
100
 
101
101
  it "should tell ncover.reporting to produce a full coverage html report in the specified folder" do
102
- $system_command.should include("//or FullCoverageReport:Html:\"#{@fullcoverage_output_folder}\"")
102
+ @ncover.system_command.should include("//or FullCoverageReport:Html:\"#{@fullcoverage_output_folder}\"")
103
103
  end
104
104
 
105
105
  it "should tell ncover.reporting to produce a summary html report in the specified folder" do
106
- $system_command.should include("//or Summary:Html:\"#{NCoverReportTestData.summary_output_file}\"")
106
+ @ncover.system_command.should include("//or Summary:Html:\"#{NCoverReportTestData.summary_output_file}\"")
107
107
  end
108
108
  end
109
109
 
@@ -130,7 +130,7 @@ describe NCoverReport, "when running a report with a specified minimum symbol co
130
130
  end
131
131
 
132
132
  it "should tell ncover.reporting to check for the specified minimum coverage" do
133
- $system_command.should include("//mc SymbolCoverage:10:View")
133
+ @ncover.system_command.should include("//mc SymbolCoverage:10:View")
134
134
  end
135
135
 
136
136
  it "should not fail the execution" do
@@ -165,7 +165,7 @@ describe NCoverReport, "when running a report with a specified minimum symbol co
165
165
  end
166
166
 
167
167
  it "should tell ncover.reporting to check for the specified minimum coverage" do
168
- $system_command.should include("//mc SymbolCoverage:10")
168
+ @ncover.system_command.should include("//mc SymbolCoverage:10")
169
169
  end
170
170
 
171
171
  it "should fail the execution" do
@@ -201,7 +201,7 @@ describe NCoverReport, "when specifying the coverage item type to check" do
201
201
  end
202
202
 
203
203
  it "should tell ncover.reporting to check for the specified item type" do
204
- $system_command.should include("//mc SymbolCoverage:10:Class")
204
+ @ncover.system_command.should include("//mc SymbolCoverage:10:Class")
205
205
  end
206
206
 
207
207
  it "should produce the report" do
@@ -232,15 +232,15 @@ describe NCoverReport, "when checking more than one type of coverage and all fai
232
232
  end
233
233
 
234
234
  it "should tell ncover.reporting to check for the symbol coverage" do
235
- $system_command.should include("//mc SymbolCoverage:100:View")
235
+ @ncover.system_command.should include("//mc SymbolCoverage:100:View")
236
236
  end
237
237
 
238
238
  it "should tell ncover.reporting to check for the branch coverage" do
239
- $system_command.should include("//mc BranchCoverage:10:Class")
239
+ @ncover.system_command.should include("//mc BranchCoverage:10:Class")
240
240
  end
241
241
 
242
242
  it "should tell ncover.reporting to check for the branch coverage" do
243
- $system_command.should include("//mc MethodCoverage:100:Class")
243
+ @ncover.system_command.should include("//mc MethodCoverage:100:Class")
244
244
  end
245
245
 
246
246
  it "should produce the report" do
@@ -275,15 +275,15 @@ describe NCoverReport, "when checking more than one type of coverage and all pas
275
275
  end
276
276
 
277
277
  it "should tell ncover.reporting to check for the symbol coverage" do
278
- $system_command.should include("//mc SymbolCoverage:0:View")
278
+ @ncover.system_command.should include("//mc SymbolCoverage:0:View")
279
279
  end
280
280
 
281
281
  it "should tell ncover.reporting to check for the branch coverage" do
282
- $system_command.should include("//mc BranchCoverage:0:Class")
282
+ @ncover.system_command.should include("//mc BranchCoverage:0:Class")
283
283
  end
284
284
 
285
285
  it "should tell ncover.reporting to check for the method coverage" do
286
- $system_command.should include("//mc MethodCoverage:0:Class")
286
+ @ncover.system_command.should include("//mc MethodCoverage:0:Class")
287
287
  end
288
288
 
289
289
  it "should produce the report" do
@@ -317,11 +317,11 @@ describe NCoverReport, "when checking more than one type of coverage and one fai
317
317
  end
318
318
 
319
319
  it "should tell ncover.reporting to check for the symbol coverage" do
320
- $system_command.should include("//mc SymbolCoverage:100:View")
320
+ @ncover.system_command.should include("//mc SymbolCoverage:100:View")
321
321
  end
322
322
 
323
323
  it "should tell ncover.reporting to check for the branch coverage" do
324
- $system_command.should include("//mc BranchCoverage:0:Class")
324
+ @ncover.system_command.should include("//mc BranchCoverage:0:Class")
325
325
  end
326
326
 
327
327
  it "should produce the report" do
@@ -355,7 +355,7 @@ describe NCoverReport, "when running a report with a cyclomatic complexity highe
355
355
  end
356
356
 
357
357
  it "should tell ncover.reporting to check for the maximum cyclomatic complexity" do
358
- $system_command.should include("//mc CyclomaticComplexity:1:Class")
358
+ @ncover.system_command.should include("//mc CyclomaticComplexity:1:Class")
359
359
  end
360
360
 
361
361
  it "should fail the execution" do
@@ -389,7 +389,7 @@ describe NCoverReport, "when running a report with a cyclomatic complexity under
389
389
  end
390
390
 
391
391
  it "should tell ncover.reporting to check for the maximum cyclomatic complexity" do
392
- $system_command.should include("//mc CyclomaticComplexity:1000:View")
392
+ @ncover.system_command.should include("//mc CyclomaticComplexity:1000:View")
393
393
  end
394
394
 
395
395
  it "should not fail the execution" do
@@ -424,11 +424,11 @@ describe NCoverReport, "when filtering on Assembly coverage data" do
424
424
  end
425
425
 
426
426
  it "should exclude the specified assemblies data" do
427
- $system_command.should include("//cf \"nunit.*\":Assembly:false:false")
427
+ @ncover.system_command.should include("//cf \"nunit.*\":Assembly:false:false")
428
428
  end
429
429
 
430
430
  it "should include the specified assemblies data" do
431
- $system_command.should include("//cf \"TestSolution.*\":Assembly:false:true")
431
+ @ncover.system_command.should include("//cf \"TestSolution.*\":Assembly:false:true")
432
432
  end
433
433
 
434
434
  it "should not fail" do
@@ -459,11 +459,11 @@ describe NCoverReport, "when filtering on Namespace coverage data" do
459
459
  end
460
460
 
461
461
  it "should exclude the specified data" do
462
- $system_command.should include("//cf \"nunit.*\":Namespace:false:false")
462
+ @ncover.system_command.should include("//cf \"nunit.*\":Namespace:false:false")
463
463
  end
464
464
 
465
465
  it "should include the specified data" do
466
- $system_command.should include("//cf \"TestSolution.*\":Namespace:false:true")
466
+ @ncover.system_command.should include("//cf \"TestSolution.*\":Namespace:false:true")
467
467
  end
468
468
 
469
469
  it "should not fail" do
@@ -494,11 +494,11 @@ describe NCoverReport, "when filtering on Class coverage data" do
494
494
  end
495
495
 
496
496
  it "should exclude the specified data" do
497
- $system_command.should include("//cf \"Foo\":Class:false:false")
497
+ @ncover.system_command.should include("//cf \"Foo\":Class:false:false")
498
498
  end
499
499
 
500
500
  it "should include the specified data" do
501
- $system_command.should include("//cf \"Bar\":Class:false:true")
501
+ @ncover.system_command.should include("//cf \"Bar\":Class:false:true")
502
502
  end
503
503
 
504
504
  it "should not fail" do
@@ -529,11 +529,11 @@ describe NCoverReport, "when filtering on Method coverage data" do
529
529
  end
530
530
 
531
531
  it "should exclude the specified data" do
532
- $system_command.should include("//cf \"Foo\":Method:false:false")
532
+ @ncover.system_command.should include("//cf \"Foo\":Method:false:false")
533
533
  end
534
534
 
535
535
  it "should include the specified data" do
536
- $system_command.should include("//cf \"Bar\":Method:false:true")
536
+ @ncover.system_command.should include("//cf \"Bar\":Method:false:true")
537
537
  end
538
538
 
539
539
  it "should not fail" do
@@ -564,11 +564,11 @@ describe NCoverReport, "when filtering on Document coverage data" do
564
564
  end
565
565
 
566
566
  it "should exclude the specified data" do
567
- $system_command.should include("//cf \"Foo\":Document:false:false")
567
+ @ncover.system_command.should include("//cf \"Foo\":Document:false:false")
568
568
  end
569
569
 
570
570
  it "should include the specified data" do
571
- $system_command.should include("//cf \"Bar\":Document:false:true")
571
+ @ncover.system_command.should include("//cf \"Bar\":Document:false:true")
572
572
  end
573
573
 
574
574
  it "should not fail" do