albacore 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. data/README.markdown +84 -81
  2. data/VERSION +1 -1
  3. data/install_dependencies.rb +10 -10
  4. data/lib/albacore.rb +10 -2
  5. data/lib/albacore/assemblyinfo.rb +100 -100
  6. data/lib/albacore/assemblyinfolanguages/csharpengine.rb +14 -0
  7. data/lib/albacore/assemblyinfolanguages/vbnetengine.rb +14 -0
  8. data/lib/albacore/docu.rb +39 -0
  9. data/lib/albacore/exec.rb +23 -0
  10. data/lib/albacore/expandtemplates.rb +73 -71
  11. data/lib/albacore/msbuild.rb +56 -61
  12. data/lib/albacore/mspectestrunner.rb +44 -42
  13. data/lib/albacore/nant.rb +39 -0
  14. data/lib/albacore/ncoverconsole.rb +68 -61
  15. data/lib/albacore/ncoverreport.rb +56 -55
  16. data/lib/albacore/ncoverreports/assemblyfilter.rb +7 -7
  17. data/lib/albacore/ncoverreports/branchcoverage.rb +7 -7
  18. data/lib/albacore/ncoverreports/classfilter.rb +5 -5
  19. data/lib/albacore/ncoverreports/codecoveragebase.rb +22 -22
  20. data/lib/albacore/ncoverreports/cyclomaticcomplexity.rb +19 -19
  21. data/lib/albacore/ncoverreports/documentfilter.rb +5 -5
  22. data/lib/albacore/ncoverreports/fullcoveragereport.rb +17 -17
  23. data/lib/albacore/ncoverreports/methodcoverage.rb +7 -7
  24. data/lib/albacore/ncoverreports/methodfilter.rb +5 -5
  25. data/lib/albacore/ncoverreports/namespacefilter.rb +5 -5
  26. data/lib/albacore/ncoverreports/reportfilterbase.rb +23 -23
  27. data/lib/albacore/ncoverreports/summaryreport.rb +18 -18
  28. data/lib/albacore/ncoverreports/symbolcoverage.rb +6 -7
  29. data/lib/albacore/ndepend.rb +35 -0
  30. data/lib/albacore/nunittestrunner.rb +36 -35
  31. data/lib/albacore/plink.rb +48 -0
  32. data/lib/albacore/sftp.rb +33 -31
  33. data/lib/albacore/sqlcmd.rb +54 -51
  34. data/lib/albacore/ssh.rb +35 -33
  35. data/lib/albacore/support/albacore_helper.rb +1 -4
  36. data/lib/albacore/support/attrmethods.rb +25 -0
  37. data/lib/albacore/support/failure.rb +17 -17
  38. data/lib/albacore/support/globalconfig.rb +6 -0
  39. data/lib/albacore/support/logging.rb +30 -28
  40. data/lib/albacore/support/runcommand.rb +41 -41
  41. data/lib/albacore/support/yamlconfig.rb +23 -27
  42. data/lib/albacore/unzip.rb +28 -0
  43. data/lib/albacore/xbuild.rb +54 -0
  44. data/lib/albacore/xunittestrunner.rb +40 -43
  45. data/lib/albacore/zipdirectory.rb +72 -63
  46. data/lib/rake/assemblyinfotask.rb +12 -11
  47. data/lib/rake/docutask.rb +17 -0
  48. data/lib/rake/exectask.rb +18 -0
  49. data/lib/rake/expandtemplatestask.rb +12 -11
  50. data/lib/rake/msbuildtask.rb +13 -12
  51. data/lib/rake/mspectask.rb +12 -11
  52. data/lib/rake/nanttask.rb +17 -0
  53. data/lib/rake/ncoverconsoletask.rb +12 -11
  54. data/lib/rake/ncoverreporttask.rb +12 -11
  55. data/lib/rake/ndependtask.rb +23 -0
  56. data/lib/rake/nunittask.rb +12 -11
  57. data/lib/rake/plinktask.rb +23 -0
  58. data/lib/rake/renametask.rb +15 -15
  59. data/lib/rake/sftptask.rb +11 -10
  60. data/lib/rake/sqlcmdtask.rb +13 -12
  61. data/lib/rake/sshtask.rb +11 -10
  62. data/lib/rake/support/albacoretask.rb +16 -15
  63. data/lib/rake/unziptask.rb +17 -0
  64. data/lib/rake/xbuildtask.rb +22 -0
  65. data/lib/rake/xunittask.rb +12 -11
  66. data/lib/rake/ziptask.rb +12 -11
  67. data/rakefile.rb +255 -204
  68. data/spec/assemblyinfo_spec.rb +426 -221
  69. data/spec/assemblyinfotask_spec.rb +21 -21
  70. data/spec/docu_spec.rb +70 -0
  71. data/spec/docutask_spec.rb +39 -0
  72. data/spec/exec_spec.rb +23 -0
  73. data/spec/exectask_spec.rb +31 -0
  74. data/spec/expandtemplates_spec.rb +149 -148
  75. data/spec/expandtemplatestask_spec.rb +21 -21
  76. data/spec/msbuild_spec.rb +150 -139
  77. data/spec/msbuildtask_spec.rb +21 -21
  78. data/spec/mspectask_spec.rb +21 -21
  79. data/spec/nant_spec.rb +101 -0
  80. data/spec/nanttask_spec.rb +31 -0
  81. data/spec/ncoverconsole_spec.rb +253 -221
  82. data/spec/ncoverconsoletask_spec.rb +21 -21
  83. data/spec/ncoverreport_spec.rb +538 -523
  84. data/spec/ncoverreporttask_spec.rb +21 -21
  85. data/spec/ndepend_spec.rb +49 -0
  86. data/spec/{commandtask_spec.rb → ndependtask_spec.rb} +10 -10
  87. data/spec/nunittask_spec.rb +21 -21
  88. data/spec/nunittestrunner_spec.rb +6 -6
  89. data/spec/patches/docu_patch.rb +13 -0
  90. data/spec/patches/system_patch.rb +18 -18
  91. data/spec/patches/tasklib_patch.rb +10 -10
  92. data/spec/plink_spec.rb +61 -0
  93. data/spec/plinktask_spec.rb +31 -0
  94. data/spec/renametask_spec.rb +21 -21
  95. data/spec/sftp_spec.rb +24 -24
  96. data/spec/sftptask_spec.rb +31 -31
  97. data/spec/sqlcmd_spec.rb +118 -120
  98. data/spec/sqlcmdtask_spec.rb +21 -21
  99. data/spec/ssh_spec.rb +36 -37
  100. data/spec/sshtask_spec.rb +29 -29
  101. data/spec/support/TestSolution/NDependProject.xml +315 -0
  102. data/spec/support/TestSolution/TestSolution.XUnitTests/Class1.cs +12 -12
  103. data/spec/support/TestSolution/TestSolution.XUnitTests/FailingTestFixture.cs +14 -0
  104. data/spec/support/TestSolution/TestSolution.XUnitTests/TestSolution.XUnitTests.csproj +1 -0
  105. data/spec/support/TestSolution/TestSolution.build +25 -0
  106. data/spec/support/assemblyinfotester.rb +40 -38
  107. data/spec/support/expandtemplatestestdata.rb +73 -73
  108. data/spec/support/msbuildtestdata.rb +28 -28
  109. data/spec/support/nanttestdata.rb +33 -0
  110. data/spec/support/ncoverconsoletestdata.rb +18 -0
  111. data/spec/support/ncoverreporttestdata.rb +24 -24
  112. data/spec/support/spec_helper.rb +2 -1
  113. data/spec/support/yamlconfig/msbuild.yml +3 -0
  114. data/spec/support/yamlconfig/yaml_autoconfig_test.yml +1 -0
  115. data/spec/support/ziptestdata.rb +11 -6
  116. data/spec/xunit_spec.rb +63 -0
  117. data/spec/xunittask_spec.rb +19 -19
  118. data/spec/yamlconfig_spec.rb +38 -52
  119. data/spec/zip_spec.rb +56 -11
  120. data/spec/ziptask_spec.rb +22 -22
  121. metadata +53 -8
  122. data/lib/albacore/command.rb +0 -23
  123. data/lib/rake/commandtask.rb +0 -16
  124. data/spec/command_spec.rb +0 -23
@@ -4,28 +4,28 @@ require 'rake/ncoverconsoletask'
4
4
  require 'tasklib_patch'
5
5
 
6
6
  describe Albacore::NCoverConsoleTask, "when running" do
7
- before :all do
8
- task = Albacore::NCoverConsoleTask.new(:ncoverconsole) do |t|
9
- @yielded_object = t
10
- end
11
- task.extend(TasklibPatch)
12
- Rake::Task[:ncoverconsole].invoke
13
- end
14
-
15
- it "should yield the ncover console api" do
16
- @yielded_object.kind_of?(NCoverConsole).should == true
17
- end
7
+ before :all do
8
+ task = Albacore::NCoverConsoleTask.new(:ncoverconsole) do |t|
9
+ @yielded_object = t
10
+ end
11
+ task.extend(TasklibPatch)
12
+ Rake::Task[:ncoverconsole].invoke
13
+ end
14
+
15
+ it "should yield the ncover console api" do
16
+ @yielded_object.kind_of?(NCoverConsole).should == true
17
+ end
18
18
  end
19
19
 
20
20
  describe Albacore::NCoverConsoleTask, "when execution fails" do
21
- before :all do
22
- @task = Albacore::NCoverConsoleTask.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
21
+ before :all do
22
+ @task = Albacore::NCoverConsoleTask.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
31
  end
@@ -3,575 +3,590 @@ require 'albacore/ncoverreport'
3
3
  require 'ncoverreporttestdata'
4
4
 
5
5
  describe NCoverReport, "when runnign without the ncover report location specified" do
6
- before :all do
7
- @ncover = NCoverReport.new
8
- @ncover.run
9
- end
10
-
11
- it "should fail execution" do
12
- @ncover.failed.should be_true
13
- end
6
+ before :all do
7
+ @ncover = NCoverReport.new
8
+ @ncover.run
9
+ end
10
+
11
+ it "should fail execution" do
12
+ @ncover.failed.should be_true
13
+ end
14
14
  end
15
15
 
16
16
  describe NCoverReport, "when running a full coverage report with a specified output folder" do
17
- before :all do
18
- NCoverReportTestData.clean_output_folder
19
-
20
- @ncover = NCoverReport.new
21
- @ncover.extend(SystemPatch)
22
- @ncover.log_level = :verbose
23
-
24
- @ncover.path_to_command = NCoverReportTestData.path_to_command
25
- @ncover.coverage_files << NCoverReportTestData.coverage_file
26
-
27
- fullcoveragereport = NCover::FullCoverageReport.new()
28
- fullcoveragereport.output_path = NCoverReportTestData.output_folder
29
- @ncover.reports << fullcoveragereport
30
-
31
- @ncover.run
32
- end
33
-
34
- it "should execute ncover.reporting" do
35
- @ncover.system_command.should include(NCoverReportTestData.path_to_command)
36
- end
37
-
38
- it "should tell ncover.reporting to produce a full coverage html report in the specified folder" do
39
- @ncover.system_command.should include("//or FullCoverageReport:Html:\"#{NCoverReportTestData.output_folder}\"")
40
- end
41
-
42
- it "should produce the report" do
43
- File.exist?(File.join(NCoverReportTestData.output_folder, "fullcoveragereport.html")).should be_true
44
- end
17
+ before :all do
18
+ NCoverReportTestData.clean_output_folder
19
+
20
+ @ncover = NCoverReport.new
21
+ @ncover.extend(SystemPatch)
22
+ @ncover.log_level = :verbose
23
+
24
+ @ncover.path_to_command = NCoverReportTestData.path_to_command
25
+ @ncover.coverage_files NCoverReportTestData.coverage_file
26
+
27
+ fullcoveragereport = NCover::FullCoverageReport.new()
28
+ fullcoveragereport.output_path = NCoverReportTestData.output_folder
29
+ @ncover.reports fullcoveragereport
30
+
31
+ @ncover.run
32
+ end
33
+
34
+ it "should execute ncover.reporting" do
35
+ @ncover.system_command.should include(NCoverReportTestData.path_to_command)
36
+ end
37
+
38
+ it "should tell ncover.reporting to produce a full coverage html report in the specified folder" do
39
+ @ncover.system_command.should include("//or FullCoverageReport:Html:\"#{NCoverReportTestData.output_folder}\"")
40
+ end
41
+
42
+ it "should produce the report" do
43
+ File.exist?(File.join(NCoverReportTestData.output_folder, "fullcoveragereport.html")).should be_true
44
+ end
45
45
  end
46
46
 
47
47
  describe NCoverReport, "when running a summary report with a specified output folder" do
48
- before :all do
49
- NCoverReportTestData.clean_output_folder
50
-
51
- @ncover = NCoverReport.new
52
- @ncover.extend(SystemPatch)
53
- @ncover.log_level = :verbose
54
-
55
- @ncover.path_to_command = NCoverReportTestData.path_to_command
56
- @ncover.coverage_files << NCoverReportTestData.coverage_file
57
-
58
- summaryreport = NCover::SummaryReport.new()
59
- summaryreport.output_path = NCoverReportTestData.summary_output_file
60
- @ncover.reports << summaryreport
61
-
62
- @ncover.run
63
- end
64
-
65
- it "should execute ncover.reporting" do
66
- @ncover.system_command.should include(NCoverReportTestData.path_to_command)
67
- end
68
-
69
- it "should tell ncover.reporting to produce a summary html report in the specified folder" do
70
- @ncover.system_command.should include("//or Summary:Html:\"#{NCoverReportTestData.summary_output_file}\"")
71
- end
72
-
73
- it "should produce the report" do
74
- File.exist?(NCoverReportTestData.summary_output_file).should be_true
75
- end
48
+ before :all do
49
+ NCoverReportTestData.clean_output_folder
50
+
51
+ @ncover = NCoverReport.new
52
+ @ncover.extend(SystemPatch)
53
+ @ncover.log_level = :verbose
54
+
55
+ @ncover.path_to_command = NCoverReportTestData.path_to_command
56
+ @ncover.coverage_files NCoverReportTestData.coverage_file
57
+
58
+ summaryreport = NCover::SummaryReport.new()
59
+ summaryreport.output_path = NCoverReportTestData.summary_output_file
60
+ @ncover.reports summaryreport
61
+
62
+ @ncover.run
63
+ end
64
+
65
+ it "should execute ncover.reporting" do
66
+ @ncover.system_command.should include(NCoverReportTestData.path_to_command)
67
+ end
68
+
69
+ it "should tell ncover.reporting to produce a summary html report in the specified folder" do
70
+ @ncover.system_command.should include("//or Summary:Html:\"#{NCoverReportTestData.summary_output_file}\"")
71
+ end
72
+
73
+ it "should produce the report" do
74
+ File.exist?(NCoverReportTestData.summary_output_file).should be_true
75
+ end
76
76
  end
77
77
 
78
78
  describe NCoverReport, "when running multiple ncover reports - a summary and a full coverage report" do
79
- before :all do
80
- NCoverReportTestData.clean_output_folder
81
-
82
- @ncover = NCoverReport.new
83
- @ncover.extend(SystemPatch)
84
- @ncover.log_level = :verbose
85
-
86
- @ncover.path_to_command = NCoverReportTestData.path_to_command
87
- @ncover.coverage_files << NCoverReportTestData.coverage_file
88
-
89
- summaryreport = NCover::SummaryReport.new()
90
- summaryreport.output_path = NCoverReportTestData.summary_output_file
91
- @ncover.reports << summaryreport
92
-
93
- fullcoveragereport = NCover::FullCoverageReport.new()
94
- @fullcoverage_output_folder = File.join(NCoverReportTestData.output_folder, "fullcoverage")
95
- fullcoveragereport.output_path = @fullcoverage_output_folder
96
- @ncover.reports << fullcoveragereport
97
-
98
- @ncover.run
99
- end
100
-
101
- it "should tell ncover.reporting to produce a full coverage html report in the specified folder" do
102
- @ncover.system_command.should include("//or FullCoverageReport:Html:\"#{@fullcoverage_output_folder}\"")
103
- end
104
-
105
- it "should tell ncover.reporting to produce a summary html report in the specified folder" do
106
- @ncover.system_command.should include("//or Summary:Html:\"#{NCoverReportTestData.summary_output_file}\"")
107
- end
79
+ before :all do
80
+ NCoverReportTestData.clean_output_folder
81
+
82
+ @ncover = NCoverReport.new
83
+ @ncover.extend(SystemPatch)
84
+ @ncover.log_level = :verbose
85
+
86
+ @ncover.path_to_command = NCoverReportTestData.path_to_command
87
+ @ncover.coverage_files NCoverReportTestData.coverage_file
88
+
89
+ summaryreport = NCover::SummaryReport.new()
90
+ summaryreport.output_path = NCoverReportTestData.summary_output_file
91
+
92
+ fullcoveragereport = NCover::FullCoverageReport.new()
93
+ @fullcoverage_output_folder = File.join(NCoverReportTestData.output_folder, "fullcoverage")
94
+ fullcoveragereport.output_path = @fullcoverage_output_folder
95
+ @ncover.reports summaryreport, fullcoveragereport
96
+
97
+ @ncover.run
98
+ end
99
+
100
+ it "should tell ncover.reporting to produce a full coverage html report in the specified folder" do
101
+ @ncover.system_command.should include("//or FullCoverageReport:Html:\"#{@fullcoverage_output_folder}\"")
102
+ end
103
+
104
+ it "should tell ncover.reporting to produce a summary html report in the specified folder" do
105
+ @ncover.system_command.should include("//or Summary:Html:\"#{NCoverReportTestData.summary_output_file}\"")
106
+ end
108
107
  end
109
108
 
110
109
  describe NCoverReport, "when running a report with a specified minimum symbol coverage lower than actual coverage" do
111
- before :all do
112
- NCoverReportTestData.clean_output_folder
113
-
114
- @ncover = NCoverReport.new
115
- @ncover.extend(SystemPatch)
116
- @ncover.log_level = :verbose
117
-
118
- @ncover.path_to_command = NCoverReportTestData.path_to_command
119
- @ncover.coverage_files << NCoverReportTestData.coverage_file
120
-
121
- fullcoveragereport = NCover::FullCoverageReport.new
122
- fullcoveragereport.output_path = NCoverReportTestData.output_folder
123
- @ncover.reports << fullcoveragereport
124
-
125
- symbolcoverage = NCover::SymbolCoverage.new
126
- symbolcoverage.minimum = 10
127
- @ncover.required_coverage << symbolcoverage
128
-
129
- @ncover.run
130
- end
131
-
132
- it "should tell ncover.reporting to check for the specified minimum coverage" do
133
- @ncover.system_command.should include("//mc SymbolCoverage:10:View")
134
- end
135
-
136
- it "should not fail the execution" do
137
- @ncover.failed.should be_false
138
- end
139
-
140
- it "should produce the report" do
141
- File.exist?(File.join(NCoverReportTestData.output_folder, "fullcoveragereport.html")).should be_true
142
- end
110
+ before :all do
111
+ NCoverReportTestData.clean_output_folder
112
+
113
+ @ncover = NCoverReport.new
114
+ @ncover.extend(SystemPatch)
115
+ @ncover.log_level = :verbose
116
+
117
+ @ncover.path_to_command = NCoverReportTestData.path_to_command
118
+ @ncover.coverage_files NCoverReportTestData.coverage_file
119
+
120
+ fullcoveragereport = NCover::FullCoverageReport.new
121
+ fullcoveragereport.output_path = NCoverReportTestData.output_folder
122
+ @ncover.reports fullcoveragereport
123
+
124
+ symbolcoverage = NCover::SymbolCoverage.new
125
+ symbolcoverage.minimum = 10
126
+ @ncover.required_coverage symbolcoverage
127
+
128
+ @ncover.run
129
+ end
130
+
131
+ it "should tell ncover.reporting to check for the specified minimum coverage" do
132
+ @ncover.system_command.should include("//mc SymbolCoverage:10:View")
133
+ end
134
+
135
+ it "should not fail the execution" do
136
+ @ncover.failed.should be_false
137
+ end
138
+
139
+ it "should produce the report" do
140
+ File.exist?(File.join(NCoverReportTestData.output_folder, "fullcoveragereport.html")).should be_true
141
+ end
143
142
  end
144
143
 
145
144
  describe NCoverReport, "when running a report with a specified minimum symbol coverage higher than actual coverage" do
146
- before :all do
147
- NCoverReportTestData.clean_output_folder
148
-
149
- @ncover = NCoverReport.new
150
- @ncover.extend(SystemPatch)
151
- @ncover.log_level = :verbose
152
-
153
- @ncover.path_to_command = NCoverReportTestData.path_to_command
154
- @ncover.coverage_files << NCoverReportTestData.coverage_file
155
-
156
- fullcoveragereport = NCover::FullCoverageReport.new
157
- fullcoveragereport.output_path = NCoverReportTestData.output_folder
158
- @ncover.reports << fullcoveragereport
159
-
160
- symbolcoverage = NCover::SymbolCoverage.new
161
- symbolcoverage.minimum = 100
162
- @ncover.required_coverage << symbolcoverage
163
-
164
- @ncover.run
165
- end
166
-
167
- it "should tell ncover.reporting to check for the specified minimum coverage" do
168
- @ncover.system_command.should include("//mc SymbolCoverage:10")
169
- end
170
-
171
- it "should fail the execution" do
172
- @ncover.failed.should be_true
173
- end
174
-
175
- it "should produce the report" do
176
- File.exist?(File.join(NCoverReportTestData.output_folder, "fullcoveragereport.html")).should be_true
177
- end
145
+ before :all do
146
+ NCoverReportTestData.clean_output_folder
147
+
148
+ @ncover = NCoverReport.new
149
+ @ncover.extend(SystemPatch)
150
+ @ncover.log_level = :verbose
151
+
152
+ @ncover.path_to_command = NCoverReportTestData.path_to_command
153
+ @ncover.coverage_files NCoverReportTestData.coverage_file
154
+
155
+ fullcoveragereport = NCover::FullCoverageReport.new
156
+ fullcoveragereport.output_path = NCoverReportTestData.output_folder
157
+ @ncover.reports fullcoveragereport
158
+
159
+ symbolcoverage = NCover::SymbolCoverage.new
160
+ symbolcoverage.minimum = 100
161
+ @ncover.required_coverage symbolcoverage
162
+
163
+ @ncover.run
164
+ end
165
+
166
+ it "should tell ncover.reporting to check for the specified minimum coverage" do
167
+ @ncover.system_command.should include("//mc SymbolCoverage:10")
168
+ end
169
+
170
+ it "should fail the execution" do
171
+ @ncover.failed.should be_true
172
+ end
173
+
174
+ it "should produce the report" do
175
+ File.exist?(File.join(NCoverReportTestData.output_folder, "fullcoveragereport.html")).should be_true
176
+ end
178
177
  end
179
178
 
180
179
  describe NCoverReport, "when specifying the coverage item type to check" do
181
- before :all do
182
- NCoverReportTestData.clean_output_folder
183
-
184
- @ncover = NCoverReport.new
185
- @ncover.extend(SystemPatch)
186
- @ncover.log_level = :verbose
187
-
188
- @ncover.path_to_command = NCoverReportTestData.path_to_command
189
- @ncover.coverage_files << NCoverReportTestData.coverage_file
190
-
191
- report = NCover::SummaryReport.new
192
- report.output_path = NCoverReportTestData.summary_output_file
193
- @ncover.reports << report
194
-
195
- symbolcoverage = NCover::SymbolCoverage.new
196
- symbolcoverage.minimum = 10
197
- symbolcoverage.item_type = :Class
198
- @ncover.required_coverage << symbolcoverage
199
-
200
- @ncover.run
201
- end
202
-
203
- it "should tell ncover.reporting to check for the specified item type" do
204
- @ncover.system_command.should include("//mc SymbolCoverage:10:Class")
205
- end
206
-
207
- it "should produce the report" do
208
- File.exist?(NCoverReportTestData.summary_output_file).should be_true
209
- end
180
+ before :all do
181
+ NCoverReportTestData.clean_output_folder
182
+
183
+ @ncover = NCoverReport.new
184
+ @ncover.extend(SystemPatch)
185
+ @ncover.log_level = :verbose
186
+
187
+ @ncover.path_to_command = NCoverReportTestData.path_to_command
188
+ @ncover.coverage_files NCoverReportTestData.coverage_file
189
+
190
+ report = NCover::SummaryReport.new
191
+ report.output_path = NCoverReportTestData.summary_output_file
192
+ @ncover.reports report
193
+
194
+ symbolcoverage = NCover::SymbolCoverage.new
195
+ symbolcoverage.minimum = 10
196
+ symbolcoverage.item_type = :Class
197
+ @ncover.required_coverage symbolcoverage
198
+
199
+ @ncover.run
200
+ end
201
+
202
+ it "should tell ncover.reporting to check for the specified item type" do
203
+ @ncover.system_command.should include("//mc SymbolCoverage:10:Class")
204
+ end
205
+
206
+ it "should produce the report" do
207
+ File.exist?(NCoverReportTestData.summary_output_file).should be_true
208
+ end
210
209
  end
211
210
 
212
211
  describe NCoverReport, "when checking more than one type of coverage and all fail" do
213
- before :all do
214
- NCoverReportTestData.clean_output_folder
215
-
216
- @ncover = NCoverReport.new
217
- @ncover.extend(SystemPatch)
218
- @ncover.log_level = :verbose
219
-
220
- @ncover.path_to_command = NCoverReportTestData.path_to_command
221
- @ncover.coverage_files << NCoverReportTestData.coverage_file
222
-
223
- fullcoveragereport = NCover::FullCoverageReport.new
224
- fullcoveragereport.output_path = NCoverReportTestData.output_folder
225
- @ncover.reports << fullcoveragereport
226
-
227
- @ncover.required_coverage << NCover::SymbolCoverage.new(:minimum => 100, :item_type => :View)
228
- @ncover.required_coverage << NCover::BranchCoverage.new(:minimum => 10, :item_type => :Class)
229
- @ncover.required_coverage << NCover::MethodCoverage.new(:minimum => 100, :item_type => :Class)
230
-
231
- @ncover.run
232
- end
233
-
234
- it "should tell ncover.reporting to check for the symbol coverage" do
235
- @ncover.system_command.should include("//mc SymbolCoverage:100:View")
236
- end
237
-
238
- it "should tell ncover.reporting to check for the branch coverage" do
239
- @ncover.system_command.should include("//mc BranchCoverage:10:Class")
240
- end
241
-
242
- it "should tell ncover.reporting to check for the branch coverage" do
243
- @ncover.system_command.should include("//mc MethodCoverage:100:Class")
244
- end
245
-
246
- it "should produce the report" do
247
- File.exist?(File.join(NCoverReportTestData.output_folder, "fullcoveragereport.html")).should be_true
248
- end
249
-
250
- it "should fail the execution" do
251
- @ncover.failed.should be_true
252
- end
212
+ before :all do
213
+ NCoverReportTestData.clean_output_folder
214
+
215
+ @ncover = NCoverReport.new
216
+ @ncover.extend(SystemPatch)
217
+ @ncover.log_level = :verbose
218
+
219
+ @ncover.path_to_command = NCoverReportTestData.path_to_command
220
+ @ncover.coverage_files NCoverReportTestData.coverage_file
221
+
222
+ fullcoveragereport = NCover::FullCoverageReport.new
223
+ fullcoveragereport.output_path = NCoverReportTestData.output_folder
224
+ @ncover.reports fullcoveragereport
225
+
226
+ @ncover.required_coverage(
227
+ NCover::SymbolCoverage.new(:minimum => 100, :item_type => :View),
228
+ NCover::BranchCoverage.new(:minimum => 10, :item_type => :Class),
229
+ NCover::MethodCoverage.new(:minimum => 100, :item_type => :Class)
230
+ )
231
+
232
+ @ncover.run
233
+ end
234
+
235
+ it "should tell ncover.reporting to check for the symbol coverage" do
236
+ @ncover.system_command.should include("//mc SymbolCoverage:100:View")
237
+ end
238
+
239
+ it "should tell ncover.reporting to check for the branch coverage" do
240
+ @ncover.system_command.should include("//mc BranchCoverage:10:Class")
241
+ end
242
+
243
+ it "should tell ncover.reporting to check for the branch coverage" do
244
+ @ncover.system_command.should include("//mc MethodCoverage:100:Class")
245
+ end
246
+
247
+ it "should produce the report" do
248
+ File.exist?(File.join(NCoverReportTestData.output_folder, "fullcoveragereport.html")).should be_true
249
+ end
250
+
251
+ it "should fail the execution" do
252
+ @ncover.failed.should be_true
253
+ end
253
254
  end
254
255
 
255
256
  describe NCoverReport, "when checking more than one type of coverage and all pass" do
256
- before :all do
257
- NCoverReportTestData.clean_output_folder
258
-
259
- @ncover = NCoverReport.new
260
- @ncover.extend(SystemPatch)
261
- @ncover.log_level = :verbose
262
-
263
- @ncover.path_to_command = NCoverReportTestData.path_to_command
264
- @ncover.coverage_files << NCoverReportTestData.coverage_file
265
-
266
- fullcoveragereport = NCover::FullCoverageReport.new
267
- fullcoveragereport.output_path = NCoverReportTestData.output_folder
268
- @ncover.reports << fullcoveragereport
269
-
270
- @ncover.required_coverage << NCover::SymbolCoverage.new(:minimum => 0, :item_type => :View)
271
- @ncover.required_coverage << NCover::BranchCoverage.new(:minimum => 0, :item_type => :Class)
272
- @ncover.required_coverage << NCover::MethodCoverage.new(:minimum => 0, :item_type => :Class)
273
-
274
- @ncover.run
275
- end
276
-
277
- it "should tell ncover.reporting to check for the symbol coverage" do
278
- @ncover.system_command.should include("//mc SymbolCoverage:0:View")
279
- end
280
-
281
- it "should tell ncover.reporting to check for the branch coverage" do
282
- @ncover.system_command.should include("//mc BranchCoverage:0:Class")
283
- end
284
-
285
- it "should tell ncover.reporting to check for the method coverage" do
286
- @ncover.system_command.should include("//mc MethodCoverage:0:Class")
287
- end
288
-
289
- it "should produce the report" do
290
- File.exist?(File.join(NCoverReportTestData.output_folder, "fullcoveragereport.html")).should be_true
291
- end
292
-
293
- it "should not fail the execution" do
294
- @ncover.failed.should be_false
295
- end
257
+ before :all do
258
+ NCoverReportTestData.clean_output_folder
259
+
260
+ @ncover = NCoverReport.new
261
+ @ncover.extend(SystemPatch)
262
+ @ncover.log_level = :verbose
263
+
264
+ @ncover.path_to_command = NCoverReportTestData.path_to_command
265
+ @ncover.coverage_files NCoverReportTestData.coverage_file
266
+
267
+ fullcoveragereport = NCover::FullCoverageReport.new
268
+ fullcoveragereport.output_path = NCoverReportTestData.output_folder
269
+ @ncover.reports fullcoveragereport
270
+
271
+ @ncover.required_coverage(
272
+ NCover::SymbolCoverage.new(:minimum => 0, :item_type => :View),
273
+ NCover::BranchCoverage.new(:minimum => 0, :item_type => :Class),
274
+ NCover::MethodCoverage.new(:minimum => 0, :item_type => :Class)
275
+ )
276
+
277
+ @ncover.run
278
+ end
279
+
280
+ it "should tell ncover.reporting to check for the symbol coverage" do
281
+ @ncover.system_command.should include("//mc SymbolCoverage:0:View")
282
+ end
283
+
284
+ it "should tell ncover.reporting to check for the branch coverage" do
285
+ @ncover.system_command.should include("//mc BranchCoverage:0:Class")
286
+ end
287
+
288
+ it "should tell ncover.reporting to check for the method coverage" do
289
+ @ncover.system_command.should include("//mc MethodCoverage:0:Class")
290
+ end
291
+
292
+ it "should produce the report" do
293
+ File.exist?(File.join(NCoverReportTestData.output_folder, "fullcoveragereport.html")).should be_true
294
+ end
295
+
296
+ it "should not fail the execution" do
297
+ @ncover.failed.should be_false
298
+ end
296
299
  end
297
300
 
298
301
  describe NCoverReport, "when checking more than one type of coverage and one fails" do
299
- before :all do
300
- NCoverReportTestData.clean_output_folder
301
-
302
- @ncover = NCoverReport.new
303
- @ncover.extend(SystemPatch)
304
- @ncover.log_level = :verbose
305
-
306
- @ncover.path_to_command = NCoverReportTestData.path_to_command
307
- @ncover.coverage_files << NCoverReportTestData.coverage_file
308
-
309
- fullcoveragereport = NCover::FullCoverageReport.new
310
- fullcoveragereport.output_path = NCoverReportTestData.output_folder
311
- @ncover.reports << fullcoveragereport
312
-
313
- @ncover.required_coverage << NCover::SymbolCoverage.new(:minimum => 100, :item_type => :View)
314
- @ncover.required_coverage << NCover::BranchCoverage.new(:minimum => 0, :item_type => :Class)
315
-
316
- @ncover.run
317
- end
318
-
319
- it "should tell ncover.reporting to check for the symbol coverage" do
320
- @ncover.system_command.should include("//mc SymbolCoverage:100:View")
321
- end
322
-
323
- it "should tell ncover.reporting to check for the branch coverage" do
324
- @ncover.system_command.should include("//mc BranchCoverage:0:Class")
325
- end
326
-
327
- it "should produce the report" do
328
- File.exist?(File.join(NCoverReportTestData.output_folder, "fullcoveragereport.html")).should be_true
329
- end
330
-
331
- it "should fail the execution" do
332
- @ncover.failed.should be_true
333
- end
302
+ before :all do
303
+ NCoverReportTestData.clean_output_folder
304
+
305
+ @ncover = NCoverReport.new
306
+ @ncover.extend(SystemPatch)
307
+ @ncover.log_level = :verbose
308
+
309
+ @ncover.path_to_command = NCoverReportTestData.path_to_command
310
+ @ncover.coverage_files NCoverReportTestData.coverage_file
311
+
312
+ fullcoveragereport = NCover::FullCoverageReport.new
313
+ fullcoveragereport.output_path = NCoverReportTestData.output_folder
314
+ @ncover.reports fullcoveragereport
315
+
316
+ @ncover.required_coverage(
317
+ NCover::SymbolCoverage.new(:minimum => 100, :item_type => :View),
318
+ NCover::BranchCoverage.new(:minimum => 0, :item_type => :Class)
319
+ )
320
+
321
+ @ncover.run
322
+ end
323
+
324
+ it "should tell ncover.reporting to check for the symbol coverage" do
325
+ @ncover.system_command.should include("//mc SymbolCoverage:100:View")
326
+ end
327
+
328
+ it "should tell ncover.reporting to check for the branch coverage" do
329
+ @ncover.system_command.should include("//mc BranchCoverage:0:Class")
330
+ end
331
+
332
+ it "should produce the report" do
333
+ File.exist?(File.join(NCoverReportTestData.output_folder, "fullcoveragereport.html")).should be_true
334
+ end
335
+
336
+ it "should fail the execution" do
337
+ @ncover.failed.should be_true
338
+ end
334
339
  end
335
340
 
336
341
  describe NCoverReport, "when running a report with a cyclomatic complexity higher than allowed" do
337
- before :all do
338
- NCoverReportTestData.clean_output_folder
339
-
340
- @ncover = NCoverReport.new
341
- @ncover.extend(SystemPatch)
342
- @ncover.log_level = :verbose
343
-
344
- @ncover.path_to_command = NCoverReportTestData.path_to_command
345
- @ncover.coverage_files << NCoverReportTestData.coverage_file
346
-
347
- fullcoveragereport = NCover::FullCoverageReport.new
348
- fullcoveragereport.output_path = NCoverReportTestData.output_folder
349
- @ncover.reports << fullcoveragereport
350
-
351
- coverage = NCover::CyclomaticComplexity.new(:maximum => 1, :item_type => :Class)
352
- @ncover.required_coverage << coverage
353
-
354
- @ncover.run
355
- end
356
-
357
- it "should tell ncover.reporting to check for the maximum cyclomatic complexity" do
358
- @ncover.system_command.should include("//mc CyclomaticComplexity:1:Class")
359
- end
360
-
361
- it "should fail the execution" do
362
- @ncover.failed.should be_true
363
- end
364
-
365
- it "should produce the report" do
366
- File.exist?(File.join(NCoverReportTestData.output_folder, "fullcoveragereport.html")).should be_true
367
- end
342
+ before :all do
343
+ NCoverReportTestData.clean_output_folder
344
+
345
+ @ncover = NCoverReport.new
346
+ @ncover.extend(SystemPatch)
347
+ @ncover.log_level = :verbose
348
+
349
+ @ncover.path_to_command = NCoverReportTestData.path_to_command
350
+ @ncover.coverage_files NCoverReportTestData.coverage_file
351
+
352
+ fullcoveragereport = NCover::FullCoverageReport.new
353
+ fullcoveragereport.output_path = NCoverReportTestData.output_folder
354
+ @ncover.reports fullcoveragereport
355
+
356
+ coverage = NCover::CyclomaticComplexity.new(:maximum => 1, :item_type => :Class)
357
+ @ncover.required_coverage coverage
358
+
359
+ @ncover.run
360
+ end
361
+
362
+ it "should tell ncover.reporting to check for the maximum cyclomatic complexity" do
363
+ @ncover.system_command.should include("//mc CyclomaticComplexity:1:Class")
364
+ end
365
+
366
+ it "should fail the execution" do
367
+ @ncover.failed.should be_true
368
+ end
369
+
370
+ it "should produce the report" do
371
+ File.exist?(File.join(NCoverReportTestData.output_folder, "fullcoveragereport.html")).should be_true
372
+ end
368
373
  end
369
374
 
370
375
  describe NCoverReport, "when running a report with a cyclomatic complexity under the limit" do
371
- before :all do
372
- NCoverReportTestData.clean_output_folder
373
-
374
- @ncover = NCoverReport.new
375
- @ncover.extend(SystemPatch)
376
- @ncover.log_level = :verbose
377
-
378
- @ncover.path_to_command = NCoverReportTestData.path_to_command
379
- @ncover.coverage_files << NCoverReportTestData.coverage_file
380
-
381
- fullcoveragereport = NCover::FullCoverageReport.new
382
- fullcoveragereport.output_path = NCoverReportTestData.output_folder
383
- @ncover.reports << fullcoveragereport
384
-
385
- coverage = NCover::CyclomaticComplexity.new(:maximum => 1000)
386
- @ncover.required_coverage << coverage
387
-
388
- @ncover.run
389
- end
390
-
391
- it "should tell ncover.reporting to check for the maximum cyclomatic complexity" do
392
- @ncover.system_command.should include("//mc CyclomaticComplexity:1000:View")
393
- end
394
-
395
- it "should not fail the execution" do
396
- @ncover.failed.should be_false
397
- end
398
-
399
- it "should produce the report" do
400
- File.exist?(File.join(NCoverReportTestData.output_folder, "fullcoveragereport.html")).should be_true
401
- end
376
+ before :all do
377
+ NCoverReportTestData.clean_output_folder
378
+
379
+ @ncover = NCoverReport.new
380
+ @ncover.extend(SystemPatch)
381
+ @ncover.log_level = :verbose
382
+
383
+ @ncover.path_to_command = NCoverReportTestData.path_to_command
384
+ @ncover.coverage_files NCoverReportTestData.coverage_file
385
+
386
+ fullcoveragereport = NCover::FullCoverageReport.new
387
+ fullcoveragereport.output_path = NCoverReportTestData.output_folder
388
+ @ncover.reports fullcoveragereport
389
+
390
+ coverage = NCover::CyclomaticComplexity.new(:maximum => 1000)
391
+ @ncover.required_coverage coverage
392
+
393
+ @ncover.run
394
+ end
395
+
396
+ it "should tell ncover.reporting to check for the maximum cyclomatic complexity" do
397
+ @ncover.system_command.should include("//mc CyclomaticComplexity:1000:View")
398
+ end
399
+
400
+ it "should not fail the execution" do
401
+ @ncover.failed.should be_false
402
+ end
403
+
404
+ it "should produce the report" do
405
+ File.exist?(File.join(NCoverReportTestData.output_folder, "fullcoveragereport.html")).should be_true
406
+ end
402
407
  end
403
408
 
404
409
  describe NCoverReport, "when filtering on Assembly coverage data" do
405
- before :all do
406
- NCoverReportTestData.clean_output_folder
407
-
408
- @ncover = NCoverReport.new
409
- @ncover.extend(SystemPatch)
410
- @ncover.log_level = :verbose
411
-
412
- @ncover.path_to_command = NCoverReportTestData.path_to_command
413
- @ncover.coverage_files << NCoverReportTestData.coverage_file
414
-
415
- fullcoveragereport = NCover::FullCoverageReport.new
416
- fullcoveragereport.output_path = NCoverReportTestData.output_folder
417
- @ncover.reports << fullcoveragereport
418
- @ncover.required_coverage << NCover::SymbolCoverage.new(:minimum => 0)
419
-
420
- @ncover.filters << NCover::AssemblyFilter.new(:filter_type => :exclude, :filter => ["nunit.*"])
421
- @ncover.filters << NCover::AssemblyFilter.new(:filter_type => :include, :filter => ["TestSolution.*"])
422
-
423
- @ncover.run
424
- end
425
-
426
- it "should exclude the specified assemblies data" do
427
- @ncover.system_command.should include("//cf \"nunit.*\":Assembly:false:false")
428
- end
429
-
430
- it "should include the specified assemblies data" do
431
- @ncover.system_command.should include("//cf \"TestSolution.*\":Assembly:false:true")
432
- end
433
-
434
- it "should not fail" do
435
- @ncover.failed.should be_false
436
- end
410
+ before :all do
411
+ NCoverReportTestData.clean_output_folder
412
+
413
+ @ncover = NCoverReport.new
414
+ @ncover.extend(SystemPatch)
415
+ @ncover.log_level = :verbose
416
+
417
+ @ncover.path_to_command = NCoverReportTestData.path_to_command
418
+ @ncover.coverage_files NCoverReportTestData.coverage_file
419
+
420
+ fullcoveragereport = NCover::FullCoverageReport.new
421
+ fullcoveragereport.output_path = NCoverReportTestData.output_folder
422
+ @ncover.reports fullcoveragereport
423
+ @ncover.required_coverage NCover::SymbolCoverage.new(:minimum => 0)
424
+
425
+ @ncover.filters(
426
+ NCover::AssemblyFilter.new(:filter_type => :exclude, :filter => ["nunit.*"]),
427
+ NCover::AssemblyFilter.new(:filter_type => :include, :filter => ["TestSolution.*"])
428
+ )
429
+
430
+ @ncover.run
431
+ end
432
+
433
+ it "should exclude the specified assemblies data" do
434
+ @ncover.system_command.should include("//cf \"nunit.*\":Assembly:false:false")
435
+ end
436
+
437
+ it "should include the specified assemblies data" do
438
+ @ncover.system_command.should include("//cf \"TestSolution.*\":Assembly:false:true")
439
+ end
440
+
441
+ it "should not fail" do
442
+ @ncover.failed.should be_false
443
+ end
437
444
  end
438
445
 
439
446
  describe NCoverReport, "when filtering on Namespace coverage data" do
440
- before :all do
441
- NCoverReportTestData.clean_output_folder
442
-
443
- @ncover = NCoverReport.new
444
- @ncover.extend(SystemPatch)
445
- @ncover.log_level = :verbose
446
-
447
- @ncover.path_to_command = NCoverReportTestData.path_to_command
448
- @ncover.coverage_files << NCoverReportTestData.coverage_file
449
-
450
- fullcoveragereport = NCover::FullCoverageReport.new
451
- fullcoveragereport.output_path = NCoverReportTestData.output_folder
452
- @ncover.reports << fullcoveragereport
453
- @ncover.required_coverage << NCover::SymbolCoverage.new(:minimum => 0)
454
-
455
- @ncover.filters << NCover::NamespaceFilter.new(:filter_type => :exclude, :filter => ["nunit.*"])
456
- @ncover.filters << NCover::NamespaceFilter.new(:filter_type => :include, :filter => ["TestSolution.*"])
457
-
458
- @ncover.run
459
- end
460
-
461
- it "should exclude the specified data" do
462
- @ncover.system_command.should include("//cf \"nunit.*\":Namespace:false:false")
463
- end
464
-
465
- it "should include the specified data" do
466
- @ncover.system_command.should include("//cf \"TestSolution.*\":Namespace:false:true")
467
- end
468
-
469
- it "should not fail" do
470
- @ncover.failed.should be_false
471
- end
447
+ before :all do
448
+ NCoverReportTestData.clean_output_folder
449
+
450
+ @ncover = NCoverReport.new
451
+ @ncover.extend(SystemPatch)
452
+ @ncover.log_level = :verbose
453
+
454
+ @ncover.path_to_command = NCoverReportTestData.path_to_command
455
+ @ncover.coverage_files NCoverReportTestData.coverage_file
456
+
457
+ fullcoveragereport = NCover::FullCoverageReport.new
458
+ fullcoveragereport.output_path = NCoverReportTestData.output_folder
459
+ @ncover.reports fullcoveragereport
460
+ @ncover.required_coverage NCover::SymbolCoverage.new(:minimum => 0)
461
+
462
+ @ncover.filters(
463
+ NCover::NamespaceFilter.new(:filter_type => :exclude, :filter => ["nunit.*"]),
464
+ NCover::NamespaceFilter.new(:filter_type => :include, :filter => ["TestSolution.*"])
465
+ )
466
+
467
+ @ncover.run
468
+ end
469
+
470
+ it "should exclude the specified data" do
471
+ @ncover.system_command.should include("//cf \"nunit.*\":Namespace:false:false")
472
+ end
473
+
474
+ it "should include the specified data" do
475
+ @ncover.system_command.should include("//cf \"TestSolution.*\":Namespace:false:true")
476
+ end
477
+
478
+ it "should not fail" do
479
+ @ncover.failed.should be_false
480
+ end
472
481
  end
473
482
 
474
483
  describe NCoverReport, "when filtering on Class coverage data" do
475
- before :all do
476
- NCoverReportTestData.clean_output_folder
477
-
478
- @ncover = NCoverReport.new
479
- @ncover.extend(SystemPatch)
480
- @ncover.log_level = :verbose
481
-
482
- @ncover.path_to_command = NCoverReportTestData.path_to_command
483
- @ncover.coverage_files << NCoverReportTestData.coverage_file
484
-
485
- fullcoveragereport = NCover::FullCoverageReport.new
486
- fullcoveragereport.output_path = NCoverReportTestData.output_folder
487
- @ncover.reports << fullcoveragereport
488
- @ncover.required_coverage << NCover::SymbolCoverage.new(:minimum => 0)
489
-
490
- @ncover.filters << NCover::ClassFilter.new(:filter_type => :exclude, :filter => ["Foo"])
491
- @ncover.filters << NCover::ClassFilter.new(:filter_type => :include, :filter => ["Bar"])
492
-
493
- @ncover.run
494
- end
495
-
496
- it "should exclude the specified data" do
497
- @ncover.system_command.should include("//cf \"Foo\":Class:false:false")
498
- end
499
-
500
- it "should include the specified data" do
501
- @ncover.system_command.should include("//cf \"Bar\":Class:false:true")
502
- end
503
-
504
- it "should not fail" do
505
- @ncover.failed.should be_false
506
- end
484
+ before :all do
485
+ NCoverReportTestData.clean_output_folder
486
+
487
+ @ncover = NCoverReport.new
488
+ @ncover.extend(SystemPatch)
489
+ @ncover.log_level = :verbose
490
+
491
+ @ncover.path_to_command = NCoverReportTestData.path_to_command
492
+ @ncover.coverage_files NCoverReportTestData.coverage_file
493
+
494
+ fullcoveragereport = NCover::FullCoverageReport.new
495
+ fullcoveragereport.output_path = NCoverReportTestData.output_folder
496
+ @ncover.reports fullcoveragereport
497
+ @ncover.required_coverage NCover::SymbolCoverage.new(:minimum => 0)
498
+
499
+ @ncover.filters(
500
+ NCover::ClassFilter.new(:filter_type => :exclude, :filter => ["Foo"]),
501
+ NCover::ClassFilter.new(:filter_type => :include, :filter => ["Bar"])
502
+ )
503
+
504
+ @ncover.run
505
+ end
506
+
507
+ it "should exclude the specified data" do
508
+ @ncover.system_command.should include("//cf \"Foo\":Class:false:false")
509
+ end
510
+
511
+ it "should include the specified data" do
512
+ @ncover.system_command.should include("//cf \"Bar\":Class:false:true")
513
+ end
514
+
515
+ it "should not fail" do
516
+ @ncover.failed.should be_false
517
+ end
507
518
  end
508
519
 
509
520
  describe NCoverReport, "when filtering on Method coverage data" do
510
- before :all do
511
- NCoverReportTestData.clean_output_folder
512
-
513
- @ncover = NCoverReport.new
514
- @ncover.extend(SystemPatch)
515
- @ncover.log_level = :verbose
516
-
517
- @ncover.path_to_command = NCoverReportTestData.path_to_command
518
- @ncover.coverage_files << NCoverReportTestData.coverage_file
519
-
520
- fullcoveragereport = NCover::FullCoverageReport.new
521
- fullcoveragereport.output_path = NCoverReportTestData.output_folder
522
- @ncover.reports << fullcoveragereport
523
- @ncover.required_coverage << NCover::SymbolCoverage.new(:minimum => 0)
524
-
525
- @ncover.filters << NCover::MethodFilter.new(:filter_type => :exclude, :filter => ["Foo"])
526
- @ncover.filters << NCover::MethodFilter.new(:filter_type => :include, :filter => ["Bar"])
527
-
528
- @ncover.run
529
- end
530
-
531
- it "should exclude the specified data" do
532
- @ncover.system_command.should include("//cf \"Foo\":Method:false:false")
533
- end
534
-
535
- it "should include the specified data" do
536
- @ncover.system_command.should include("//cf \"Bar\":Method:false:true")
537
- end
538
-
539
- it "should not fail" do
540
- @ncover.failed.should be_false
541
- end
521
+ before :all do
522
+ NCoverReportTestData.clean_output_folder
523
+
524
+ @ncover = NCoverReport.new
525
+ @ncover.extend(SystemPatch)
526
+ @ncover.log_level = :verbose
527
+
528
+ @ncover.path_to_command = NCoverReportTestData.path_to_command
529
+ @ncover.coverage_files NCoverReportTestData.coverage_file
530
+
531
+ fullcoveragereport = NCover::FullCoverageReport.new
532
+ fullcoveragereport.output_path = NCoverReportTestData.output_folder
533
+ @ncover.reports fullcoveragereport
534
+ @ncover.required_coverage NCover::SymbolCoverage.new(:minimum => 0)
535
+
536
+ @ncover.filters(
537
+ NCover::MethodFilter.new(:filter_type => :exclude, :filter => ["Foo"]),
538
+ NCover::MethodFilter.new(:filter_type => :include, :filter => ["Bar"])
539
+ )
540
+
541
+ @ncover.run
542
+ end
543
+
544
+ it "should exclude the specified data" do
545
+ @ncover.system_command.should include("//cf \"Foo\":Method:false:false")
546
+ end
547
+
548
+ it "should include the specified data" do
549
+ @ncover.system_command.should include("//cf \"Bar\":Method:false:true")
550
+ end
551
+
552
+ it "should not fail" do
553
+ @ncover.failed.should be_false
554
+ end
542
555
  end
543
556
 
544
557
  describe NCoverReport, "when filtering on Document coverage data" do
545
- before :all do
546
- NCoverReportTestData.clean_output_folder
547
-
548
- @ncover = NCoverReport.new
549
- @ncover.extend(SystemPatch)
550
- @ncover.log_level = :verbose
551
-
552
- @ncover.path_to_command = NCoverReportTestData.path_to_command
553
- @ncover.coverage_files << NCoverReportTestData.coverage_file
554
-
555
- fullcoveragereport = NCover::FullCoverageReport.new
556
- fullcoveragereport.output_path = NCoverReportTestData.output_folder
557
- @ncover.reports << fullcoveragereport
558
- @ncover.required_coverage << NCover::SymbolCoverage.new(:minimum => 0)
559
-
560
- @ncover.filters << NCover::DocumentFilter.new(:filter_type => :exclude, :filter => ["Foo"])
561
- @ncover.filters << NCover::DocumentFilter.new(:filter_type => :include, :filter => ["Bar"])
562
-
563
- @ncover.run
564
- end
565
-
566
- it "should exclude the specified data" do
567
- @ncover.system_command.should include("//cf \"Foo\":Document:false:false")
568
- end
569
-
570
- it "should include the specified data" do
571
- @ncover.system_command.should include("//cf \"Bar\":Document:false:true")
572
- end
573
-
574
- it "should not fail" do
575
- @ncover.failed.should be_false
576
- end
558
+ before :all do
559
+ NCoverReportTestData.clean_output_folder
560
+
561
+ @ncover = NCoverReport.new
562
+ @ncover.extend(SystemPatch)
563
+ @ncover.log_level = :verbose
564
+
565
+ @ncover.path_to_command = NCoverReportTestData.path_to_command
566
+ @ncover.coverage_files NCoverReportTestData.coverage_file
567
+
568
+ fullcoveragereport = NCover::FullCoverageReport.new
569
+ fullcoveragereport.output_path = NCoverReportTestData.output_folder
570
+ @ncover.reports fullcoveragereport
571
+ @ncover.required_coverage NCover::SymbolCoverage.new(:minimum => 0)
572
+
573
+ @ncover.filters(
574
+ NCover::DocumentFilter.new(:filter_type => :exclude, :filter => ["Foo"]),
575
+ NCover::DocumentFilter.new(:filter_type => :include, :filter => ["Bar"])
576
+ )
577
+
578
+ @ncover.run
579
+ end
580
+
581
+ it "should exclude the specified data" do
582
+ @ncover.system_command.should include("//cf \"Foo\":Document:false:false")
583
+ end
584
+
585
+ it "should include the specified data" do
586
+ @ncover.system_command.should include("//cf \"Bar\":Document:false:true")
587
+ end
588
+
589
+ it "should not fail" do
590
+ @ncover.failed.should be_false
591
+ end
577
592
  end