Skip to content
This repository

Use MultiJSON #74

Merged
merged 3 commits into from over 2 years ago

2 participants

Erik Michaels-Ober Christoph Olszowka
Erik Michaels-Ober

This closes issue #72 and includes some general cleanup.

Christoph Olszowka colszowka closed this September 12, 2011
Christoph Olszowka colszowka merged commit 77f442b into from September 12, 2011
Christoph Olszowka
Owner

0.5.1 is out, thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.

Showing 83 changed files with 436 additions and 431 deletions. Show diff stats Hide diff stats

  1. 2  .gitignore
  2. 2  .rvmrc
  3. 30  CHANGELOG.md
  4. 2  Gemfile
  5. 80  README.rdoc
  6. 2  Rakefile
  7. 2  cucumber.yml
  8. 8  features/config_adapters.feature
  9. 12  features/config_autoload.feature
  10. 6  features/config_command_name.feature
  11. 8  features/config_coverage_dir.feature
  12. 10  features/config_deactivate_merging.feature
  13. 8  features/config_merge_timeout.feature
  14. 8  features/config_project_name.feature
  15. 28  features/config_styles.feature
  16. 10  features/cucumber_basic.feature
  17. 10  features/merging_test_unit_and_rspec.feature
  18. 8  features/rspec_basic.feature
  19. 6  features/rspec_groups_and_filters_basic.feature
  20. 4  features/rspec_groups_and_filters_complex.feature
  21. 4  features/rspec_without_simplecov.feature
  22. 6  features/step_definitions/html_steps.rb
  23. 2  features/step_definitions/simplecov_steps.rb
  24. 2  features/step_definitions/transformers.rb
  25. 2  features/step_definitions/web_steps.rb
  26. 6  features/support/env.rb
  27. 10  features/test_unit_basic.feature
  28. 6  features/test_unit_groups_and_filters_basic.feature
  29. 4  features/test_unit_groups_and_filters_complex.feature
  30. 4  features/test_unit_without_simplecov.feature
  31. 20  lib/simplecov.rb
  32. 8  lib/simplecov/adapters.rb
  33. 2  lib/simplecov/command_guesser.rb
  34. 42  lib/simplecov/configuration.rb
  35. 6  lib/simplecov/defaults.rb
  36. 14  lib/simplecov/file_list.rb
  37. 10  lib/simplecov/filter.rb
  38. 2  lib/simplecov/formatter.rb
  39. 2  lib/simplecov/formatter/simple_formatter.rb
  40. 2  lib/simplecov/jruby_float_fix.rb
  41. 8  lib/simplecov/merge_helpers.rb
  42. 26  lib/simplecov/result.rb
  43. 26  lib/simplecov/result_merger.rb
  44. 30  lib/simplecov/source_file.rb
  45. 51  simplecov.gemspec
  46. 2  test/faked_project/Gemfile
  47. 2  test/faked_project/Rakefile
  48. 2  test/faked_project/cucumber.yml
  49. 8  test/faked_project/features/step_definitions/my_steps.rb
  50. 2  test/faked_project/features/support/env.rb
  51. 4  test/faked_project/features/test_stuff.feature
  52. 2  test/faked_project/lib/faked_project.rb
  53. 6  test/faked_project/lib/faked_project/framework_specific.rb
  54. 8  test/faked_project/lib/faked_project/meta_magic.rb
  55. 14  test/faked_project/lib/faked_project/some_class.rb
  56. 4  test/faked_project/spec/faked_spec.rb
  57. 4  test/faked_project/spec/meta_magic_spec.rb
  58. 4  test/faked_project/spec/some_class_spec.rb
  59. 2  test/faked_project/spec/spec_helper.rb
  60. 4  test/faked_project/test/faked_test.rb
  61. 4  test/faked_project/test/meta_magic_test.rb
  62. 6  test/faked_project/test/some_class_test.rb
  63. 2  test/faked_project/test/test_helper.rb
  64. 4  test/fixtures/app/controllers/sample_controller.rb
  65. 4  test/fixtures/app/models/user.rb
  66. 2  test/fixtures/frameworks/rspec_bad.rb
  67. 2  test/fixtures/frameworks/rspec_good.rb
  68. 2  test/fixtures/frameworks/testunit_bad.rb
  69. 2  test/fixtures/frameworks/testunit_good.rb
  70. 2  test/fixtures/resultset1.rb
  71. 2  test/fixtures/resultset2.rb
  72. 4  test/fixtures/sample.rb
  73. 2  test/helper.rb
  74. 4  test/shoulda_macros.rb
  75. 6  test/test_1_8_fallbacks.rb
  76. 6  test/test_command_guesser.rb
  77. 4  test/test_file_list.rb
  78. 28  test/test_filters.rb
  79. 46  test/test_merge_helpers.rb
  80. 52  test/test_result.rb
  81. 10  test/test_return_codes.rb
  82. 20  test/test_source_file.rb
  83. 44  test/test_source_file_line.rb
2  .gitignore
@@ -27,4 +27,4 @@ capybara*.html
27 27
 ## PROJECT::SPECIFIC
28 28
 
29 29
 .yardoc
30  
-doc
  30
+doc
2  .rvmrc
... ...
@@ -1 +1 @@
1  
-rvm use 1.9.2
  1
+rvm use 1.9.2
30  CHANGELOG.md
Source Rendered
... ...
@@ -1,21 +1,21 @@
1 1
 v0.5.0 (2011-09-09)
2 2
 ===================
3 3
 
4  
-  * JSON is now used instead of YAML for resultset caching (used for merging). Should resolve 
  4
+  * JSON is now used instead of YAML for resultset caching (used for merging). Should resolve
5 5
     a lot of problems people used to have because of YAML parser errors.
6  
-  
7  
-  * There's a new adapter 'test_frameworks'. Use it outside of Rails to remove `test/`, 
  6
+
  7
+  * There's a new adapter 'test_frameworks'. Use it outside of Rails to remove `test/`,
8 8
     `spec/`, `features/` and `autotest/` dirs from your coverage reports, either directly
9 9
     with `SimpleCov.start 'test_frameworks'` or with `SimpleCov.load_adapter 'test_frameworks'`
10  
-    
  10
+
11 11
   * SimpleCov configuration can now be placed centrally in a text file `.simplecov`, which will
12 12
     be automatically read on `require 'simplecov'`. This makes using custom configuration like
13 13
     groups and filters across your test suites much easier as you only have to specify your config
14 14
     once. Just put the whole `SimpleCov.start (...)` code into `APP_ROOT/.simplecov`
15  
-    
  15
+
16 16
   * Lines can now be skipped by using the :nocov: flag in comments that wrap the code that should be
17 17
     skipped, like in this example (thanks @phillipkoebbe)
18  
-  
  18
+
19 19
     <pre>
20 20
       #:nocov:
21 21
       def skipped
@@ -23,24 +23,24 @@ v0.5.0 (2011-09-09)
23 23
       end
24 24
       #:nocov:
25 25
     </pre>
26  
-  
27  
-  * Moved file set coverage analytics from simplecov-html to SimpleCov::FileList, a new subclass 
28  
-    of Array that is always returned for SourceFile lists (i.e. in groups) and can now be used 
  26
+
  27
+  * Moved file set coverage analytics from simplecov-html to SimpleCov::FileList, a new subclass
  28
+    of Array that is always returned for SourceFile lists (i.e. in groups) and can now be used
29 29
     in all formatters without the need to roll your own.
30  
-    
  30
+
31 31
   * The exceptions you used to get after removing some code and re-running your tests because SimpleCov
32 32
     couldn't find the cached source lines should be resolved (thanks @goneflyin)
33  
-    
  33
+
34 34
   * Coverage strength metric: Average hits/line per source file and result group (thanks @trans)
35  
-    
  35
+
36 36
   * Finally, SimpleCov has an extensive Cucumber test suite
37  
-  
  37
+
38 38
   * Full compatibility with Ruby 1.9.3.preview1
39 39
 
40 40
 HTML Formatter:
41 41
 ---------------
42  
-  
  42
+
43 43
   * The display of source files has been improved a lot. Weird scrolling trouble, out-of-scope line hit counts
44 44
     and such should be a thing of the past. Also, it is prettier now.
45 45
   * Source files are now syntax highlighted
46  
-  * File paths no longer have that annoying './' in front of them
  46
+  * File paths no longer have that annoying './' in front of them
2  Gemfile
@@ -6,4 +6,4 @@ if File.directory?(File.dirname(__FILE__) + '/../simplecov-html')
6 6
   gem 'simplecov-html', :path => File.dirname(__FILE__) + '/../simplecov-html'
7 7
 else
8 8
   gem 'simplecov-html', :git => 'https://github.com/colszowka/simplecov-html'
9  
-end
  9
+end
80  README.rdoc
Source Rendered
@@ -7,7 +7,7 @@
7 7
 
8 8
 SimpleCov is a code coverage analysis tool for Ruby 1.9. It uses 1.9's built-in Coverage library to gather code
9 9
 coverage data, but makes processing its results much easier by providing a clean API to filter, group, merge, format
10  
-and display those results, thus giving you a complete code coverage suite that can be set up with just a couple lines of 
  10
+and display those results, thus giving you a complete code coverage suite that can be set up with just a couple lines of
11 11
 code.
12 12
 
13 13
 In most cases, you'll want overall coverage results for your projects, including all types of tests, cucumber features
@@ -53,7 +53,7 @@ Other test frameworks should work accordingly.
53 53
 
54 54
   require 'simplecov'
55 55
   SimpleCov.start 'rails'
56  
-  
  56
+
57 57
 You could even track what kind of code your UI testers are touching if you want to go overboard with things. SimpleCov does not
58 58
 care what kind of framework it is running in, it just looks at what code is being executed and generates a report about it.
59 59
 
@@ -64,7 +64,7 @@ Configuration settings can be applied in three formats.
64 64
 The 'direct' way:
65 65
 
66 66
   SimpleCov.some_config_option 'foo'
67  
-  
  67
+
68 68
 Using a block:
69 69
 
70 70
   SimpleCov.configure do
@@ -76,12 +76,12 @@ Using a block and automatically starting the coverage:
76 76
   SimpleCov.start do
77 77
     some_config_option 'foo'
78 78
   end
79  
-  
  79
+
80 80
 Most times, you'll want to use the latter, so loading and setting up simplecov is in one place at the top of your test helper.
81 81
 
82 82
 == Running coverage only on demand
83 83
 
84  
-The Ruby STDLIB Coverage library that SimpleCov builds upon is *very* fast (i.e. on a ~10 min Rails test suite, the speed drop was 
  84
+The Ruby STDLIB Coverage library that SimpleCov builds upon is *very* fast (i.e. on a ~10 min Rails test suite, the speed drop was
85 85
 only a couple seconds for me), and therefore it's SimpleCov's policy to just generate coverage every time you run your tests because
86 86
 it doesn't do your test speed any harm and you're always equipped with the latest and greatest coverage results.
87 87
 
@@ -90,7 +90,7 @@ Because of this, SimpleCov has no explicit built-in mechanism to run coverage on
90 90
 However, you can still accomplish this very easily by introducing a ENV variable conditional into your SimpleCov setup block, like this:
91 91
 
92 92
   SimpleCov.start if ENV["COVERAGE"]
93  
-  
  93
+
94 94
 Then, SimpleCov will only run if you execute your tests like this:
95 95
 
96 96
   $ COVERAGE=true rake test
@@ -102,7 +102,7 @@ OUTSIDE of your project's root directory - otherwise you'd end up with a billion
102 102
 gems you are using.
103 103
 
104 104
 Of course you can define your own to remove things like configuration files, tests or whatever you don't need in your coverage
105  
-report. 
  105
+report.
106 106
 
107 107
 === Defining custom filters
108 108
 
@@ -110,13 +110,13 @@ You can currently define a filter using either a String (that will then be Regex
110 110
 a block or by passing in your own Filter class.
111 111
 
112 112
 ==== String filter
113  
-  
  113
+
114 114
   SimpleCov.start do
115 115
     add_filter "/test/"
116 116
   end
117  
-  
  117
+
118 118
 This simple string filter will remove all files that match "/test/" in their path.
119  
-  
  119
+
120 120
 ==== Block filter
121 121
 
122 122
   SimpleCov.start do
@@ -124,11 +124,11 @@ This simple string filter will remove all files that match "/test/" in their pat
124 124
       source_file.lines.count < 5
125 125
     end
126 126
   end
127  
-  
  127
+
128 128
 Block filters receive a SimpleCov::SourceFile instance and expect your block to return either true (if the file is to be removed
129 129
 from the result) or false (if the result should be kept). Please check out the RDoc for SimpleCov::SourceFile to learn about the
130 130
 methods available to you. In the above example, the filter will remove all files that have less then 5 lines of code.
131  
-  
  131
+
132 132
 ==== Custom filter class
133 133
 
134 134
   class LineFilter < SimpleCov::Filter
@@ -136,9 +136,9 @@ methods available to you. In the above example, the filter will remove all files
136 136
       source_file.lines.count < filter_argument
137 137
     end
138 138
   end
139  
-  
  139
+
140 140
   SimpleCov.add_filter LineFilter.new(5)
141  
-  
  141
+
142 142
 Defining your own filters is pretty easy: Just inherit from SimpleCov::Filter and define a method 'passes?(source_file)'. When running
143 143
 the filter, a true return value from this method will result in the removal of the given source_file. The filter_argument method
144 144
 is being set in the SimpleCov::Filter initialize method and thus is set to 5 in this example.
@@ -178,27 +178,27 @@ Simplecov tries to guess the name of the currently running test suite based upon
178 178
 on (from v0.3.2+). This should work fine for Unit Tests, RSpec and Cucumber. If it fails, it will use the shell command
179 179
 that invoked the test suite as a command name.
180 180
 
181  
-If you have some non-standard setup and still want nicely labeled test suites, you have to give Simplecov a cue what the 
182  
-name of the currently running test suite is. You can do so by specifying SimpleCov.command_name in one test file that is 
  181
+If you have some non-standard setup and still want nicely labeled test suites, you have to give Simplecov a cue what the
  182
+name of the currently running test suite is. You can do so by specifying SimpleCov.command_name in one test file that is
183 183
 part of your specific suite.
184 184
 
185 185
 So, to customize the suite names on a Rails app (yeah, sorry for being Rails biased, but everyone knows what
186  
-the structure of those projects is. You can apply this accordingly to the RSpecs in your Outlook-WebDAV-Calendar-Sync gem), 
  186
+the structure of those projects is. You can apply this accordingly to the RSpecs in your Outlook-WebDAV-Calendar-Sync gem),
187 187
 you could do something like this:
188 188
 
189 189
   # test/unit/some_test.rb
190 190
   SimpleCov.command_name 'test:units'
191  
-  
  191
+
192 192
   # test/functionals/some_controller_test.rb
193 193
   SimpleCov.command_name "test:functionals"
194  
-  
  194
+
195 195
   # test/integration/some_integration_test.rb
196 196
   SimpleCov.command_name "test:integration"
197  
-  
  197
+
198 198
   # features/steps/web_steps.rb
199 199
   SimpleCov.command_name "features"
200  
-  
201  
-Note that this has only to be invoked ONCE PER TEST SUITE, so even if you have 200 unit test files, specifying it in 
  200
+
  201
+Note that this has only to be invoked ONCE PER TEST SUITE, so even if you have 200 unit test files, specifying it in
202 202
 some_test.rb is fair enough.
203 203
 
204 204
 simplecov-html prints the used test suites in the footer of the generated coverage report.
@@ -216,32 +216,32 @@ You can deactivate merging altogether with "SimpleCov.use_merging false".
216 216
 
217 217
 By default, Simplecov's only config assumption is that you only want coverage reports for files inside your project
218 218
 root. To save you from repetitive configuration, you can use predefined blocks of configuration, called 'adapters',
219  
-or define your own. 
  219
+or define your own.
220 220
 
221  
-You can then pass the name of the adapter to be used as the first argument to SimpleCov.start. For example, simplecov 
  221
+You can then pass the name of the adapter to be used as the first argument to SimpleCov.start. For example, simplecov
222 222
 comes bundled with a 'rails' adapter. It looks somewhat like this:
223 223
 
224 224
   SimpleCov.adapters.define 'rails' do
225 225
     add_filter '/test/'
226 226
     add_filter '/config/'
227  
-  
  227
+
228 228
     add_group 'Controllers', 'app/controllers'
229 229
     add_group 'Models', 'app/models'
230 230
     add_group 'Helpers', 'app/helpers'
231 231
     add_group 'Libraries', 'lib'
232 232
     add_group 'Plugins', 'vendor/plugins'
233 233
   end
234  
-  
  234
+
235 235
 As you can see, it's just a glorified SimpleCov.configure block. In your test_helper.rb, launch simplecov with:
236 236
 
237 237
   SimpleCov.start 'rails'
238  
-  
  238
+
239 239
     OR
240 240
 
241 241
   SimpleCov.start 'rails' do
242 242
     # additional config here
243 243
   end
244  
-  
  244
+
245 245
 === Custom adapters
246 246
 
247 247
 You can load additional adapters with the SimpleCov.load_adapter('xyz') method. This allows you to build upon an existing
@@ -253,15 +253,15 @@ adapter and customize it so you can reuse it in unit tests and cucumber features
253 253
     load_adapter 'rails'
254 254
     add_filter 'vendor' # Don't include vendored stuff
255 255
   end
256  
-  
  256
+
257 257
   # features/support/env.rb
258 258
   require 'simplecov_custom_adapter'
259 259
   SimpleCov.start 'myadapter'
260  
-  
  260
+
261 261
   # test/test_helper.rb
262 262
   require 'simplecov_custom_adapter'
263 263
   SimpleCov.start 'myadapter'
264  
-  
  264
+
265 265
 == Customizing exit behaviour
266 266
 
267 267
 You can define what simplecov should do when your test suite finishes by customizing the at_exit hook:
@@ -269,16 +269,16 @@ You can define what simplecov should do when your test suite finishes by customi
269 269
   SimpleCov.at_exit do
270 270
     SimpleCov.result.format!
271 271
   end
272  
-  
  272
+
273 273
 Above is the default behaviour. Do whatever you like instead!
274 274
 
275 275
 == Using your own formatter
276 276
 
277  
-You can use your own formatter with: 
  277
+You can use your own formatter with:
278 278
 
279 279
   SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
280 280
 
281  
-When calling SimpleCov.result.format!, it will be invoked with SimpleCov::Formatter::YourFormatter.new.format(result), "result" 
  281
+When calling SimpleCov.result.format!, it will be invoked with SimpleCov::Formatter::YourFormatter.new.format(result), "result"
282 282
 being an instance of SimpleCov::Result. Do whatever your wish with that!
283 283
 
284 284
 == Using multiple formatters
@@ -295,21 +295,21 @@ There is currently no built-in support for this, but you could help yourself wit
295 295
 Then configure the formatter to use the new merger:
296 296
 
297 297
   SimpleCov.formatter = SimpleCov::Formatter::MergedFormatter
298  
-  
  298
+
299 299
 == Available formatters
300 300
 
301 301
 Apart from the direct companion simplecov-html (https://github.com/colszowka/simplecov-html), there are other formatters
302 302
 available:
303 303
 
304  
-==== simplecov_rcov 
305  
-by Fernando Guillen 
  304
+==== simplecov_rcov
  305
+by Fernando Guillen
306 306
 
307 307
 https://github.com/fguillen/simplecov-rcov
308 308
 
309 309
 "The target of this formatter is to cheat on Hudson so I can use the Ruby metrics plugin with SimpleCov."
310 310
 
311  
-==== simplecov_csv 
312  
-by Fernando Guillen 
  311
+==== simplecov_csv
  312
+by Fernando Guillen
313 313
 
314 314
 https://github.com/fguillen/simplecov-csv
315 315
 
@@ -331,7 +331,7 @@ http://travis-ci.org/colszowka/simplecov.png
331 331
 Only Ruby 1.9+ ships with the coverage library that SimpleCov depends upon. SimpleCov is built against various other Rubies,
332 332
 including Rubinius and JRuby, in {continuous integration}[http://travis-ci.org/colszowka/simplecov], but this happens only to
333 333
 ensure that SimpleCov does not make your test suite crash right now. Whether SimpleCov will support JRuby/Rubinius in the future
334  
-depends solely on whether those Ruby interpreters add the coverage library. 
  334
+depends solely on whether those Ruby interpreters add the coverage library.
335 335
 
336 336
 SimpleCov is built in {continuous integration}[http://travis-ci.org/colszowka/simplecov] on 1.8.6, 1.8.7, 1.9.2, ree, ruby-head,
337 337
 rbx and jruby.
2  Rakefile
@@ -11,4 +11,4 @@ end
11 11
 task :default => :test
12 12
 
13 13
 require 'cucumber/rake/task'
14  
-Cucumber::Rake::Task.new
  14
+Cucumber::Rake::Task.new
2  cucumber.yml
@@ -10,4 +10,4 @@ end
10 10
 %>
11 11
 default: <%= std_opts %><%= interp_opts %> features
12 12
 wip: --tags @wip:30 --wip features<%= interp_opts %>
13  
-rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip<%= interp_opts %>
  13
+rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip<%= interp_opts %>
8  features/config_adapters.feature
@@ -18,17 +18,17 @@ Feature:
18 18
       SimpleCov.adapters.define 'custom_command' do
19 19
         command_name "Adapter Command"
20 20
       end
21  
-      
  21
+
22 22
       SimpleCov.start do
23 23
         load_adapter 'test_frameworks'
24 24
         load_adapter 'custom_command'
25 25
       end
26 26
       """
27  
-      
  27
+
28 28
     When I open the coverage report generated with `bundle exec rake test`
29 29
     Then I should see "4 files in total."
30 30
     And I should see "using Adapter Command" within "#footer"
31  
-    
  31
+
32 32
   Scenario: Using existing adapter in custom adapter and supplying adapter to start command
33 33
     Given a file named ".simplecov" with:
34 34
       """
@@ -42,4 +42,4 @@ Feature:
42 42
 
43 43
     When I open the coverage report generated with `bundle exec rake test`
44 44
     Then I should see "4 files in total."
45  
-    And I should see "using My Adapter" within "#footer"
  45
+    And I should see "using My Adapter" within "#footer"
12  features/config_autoload.feature
@@ -2,11 +2,11 @@
2 2
 Feature:
3 3
 
4 4
   If you have multiple test suites, it can be a bit cumbersome
5  
-  to keep the configuration across them in sync. SimpleCov 
  5
+  to keep the configuration across them in sync. SimpleCov
6 6
   is able to find a config file called '.simplecov' that resides
7 7
   in your project's root and will automatically use it when
8 8
   loaded.
9  
-  
  9
+
10 10
   This gives you the ability to configure SimpleCov just once
11 11
   and then use the same configuration on all test suites simply
12 12
   by doing a 'require "simplecov"'
@@ -28,20 +28,20 @@ Feature:
28 28
       """
29 29
       require 'simplecov'
30 30
       """
31  
-      
  31
+
32 32
     When I successfully run `bundle exec rake test`
33 33
     And I open the coverage report generated with `bundle exec rspec spec`
34 34
     Then the report should be based upon:
35 35
       | RSpec      |
36 36
       | Unit Tests |
37  
-      
  37
+
38 38
     And I should see the groups:
39 39
       | name      | coverage | files |
40 40
       | All Files | 90.7%    | 4     |
41  
-      
  41
+
42 42
     And I should see the source files:
43 43
       | name                                    | coverage |
44 44
       | lib/faked_project.rb                    | 100.0 %  |
45 45
       | lib/faked_project/some_class.rb         |  80.0 %  |
46 46
       | lib/faked_project/framework_specific.rb |  87.5 %  |
47  
-      | lib/faked_project/meta_magic.rb         | 100.0 %  |
  47
+      | lib/faked_project/meta_magic.rb         | 100.0 %  |
6  features/config_command_name.feature
@@ -3,7 +3,7 @@ Feature: Custom names for individual test suites
3 3
 
4 4
   Each test suite needs a name it can be identified by. SimpleCov tries
5 5
   best to detect Rails' Unit, Functional, Integration tests as well as regular
6  
-  Test/Unit, RSpec and Cucumber, but if that is insufficient, each test suite 
  6
+  Test/Unit, RSpec and Cucumber, but if that is insufficient, each test suite
7 7
   config can be given a custom command name using SimpleCov.command_name.
8 8
 
9 9
   Scenario:
@@ -22,11 +22,11 @@ Feature: Custom names for individual test suites
22 22
         command_name "Dreck macht Speck"
23 23
       end
24 24
       """
25  
-      
  25
+
26 26
     When I open the coverage report generated with `bundle exec rake test`
27 27
     Then the report should be based upon:
28 28
       | I'm in UR Unitz |
29  
-    
  29
+
30 30
     When I open the coverage report generated with `bundle exec rspec spec`
31 31
     Then the report should be based upon:
32 32
       | Dreck macht Speck |
8  features/config_coverage_dir.feature
... ...
@@ -1,11 +1,11 @@
1 1
 @test_unit @config
2 2
 Feature:
3  
-  
  3
+
4 4
   The output directory for test coverage can be customized
5 5
   with the SimpleCov.coverage_dir setting. All coverage reports
6 6
   will be put there instead of the default 'coverage' directory
7 7
   in your project's root.
8  
-  
  8
+
9 9
   Scenario:
10 10
     Given I cd to "project"
11 11
     Given a file named "test/simplecov_config.rb" with:
@@ -15,7 +15,7 @@ Feature:
15 15
         coverage_dir 'test/simplecov'
16 16
       end
17 17
       """
18  
-      
  18
+
19 19
     When I successfully run `bundle exec rake test`
20 20
     Then a coverage report should have been generated in "test/simplecov"
21  
-    And a directory named "coverage" should not exist
  21
+    And a directory named "coverage" should not exist
10  features/config_deactivate_merging.feature
... ...
@@ -1,10 +1,10 @@
1 1
 @test_unit @rspec @merging @config
2  
-Feature: 
  2
+Feature:
3 3
 
4 4
   If merging of test suite results is not desired, it can be deactivated,
5 5
   thus leading to the coverage report being overwritten with the latest results
6 6
   of a single test suite on each run of any suite.
7  
-  
  7
+
8 8
   It's probably preferrable to generate the individual suite results into separate
9 9
   output directories instead (see SimpleCov.coverage_dir), but it is possible :)
10 10
 
@@ -24,7 +24,7 @@ Feature:
24 24
         use_merging false
25 25
       end
26 26
       """
27  
-      
  27
+
28 28
     When I successfully run `bundle exec rake test`
29 29
     Then a file named "coverage/index.html" should exist
30 30
       But a file named "coverage/.resultset.json" should not exist
@@ -32,11 +32,11 @@ Feature:
32 32
     Given I open the coverage report
33 33
     Then the report should be based upon:
34 34
       | Unit Tests |
35  
-    
  35
+
36 36
     When I successfully run `bundle exec rspec spec`
37 37
     Then a file named "coverage/index.html" should exist
38 38
       But a file named "coverage/.resultset.json" should not exist
39  
-      
  39
+
40 40
     Given I open the coverage report
41 41
     Then the report should be based upon:
42 42
       | RSpec |
8  features/config_merge_timeout.feature
... ...
@@ -1,12 +1,12 @@
1 1
 @test_unit @rspec @merging @config
2  
-Feature: 
  2
+Feature:
3 3
 
4 4
   The maximum time between resultset merges can be customized
5 5
   using SimpleCov.merge_timeout SECONDS. This can be helpful for
6 6
   long-running test-suites that fail to merge because of the time
7 7
   between individual suite finishes is more then the default timeout
8 8
   of 10 minutes.
9  
-  
  9
+
10 10
   Here, for the sake of testing the opposite case is shown, choosing
11 11
   a merge timeout so short that the first test suite's results actually
12 12
   are out of date when the second suite finishes and thus does not end up
@@ -28,11 +28,11 @@ Feature:
28 28
         merge_timeout 1
29 29
       end
30 30
       """
31  
-      
  31
+
32 32
     When I open the coverage report generated with `bundle exec rake test`
33 33
     Then the report should be based upon:
34 34
       | Unit Tests |
35  
-    
  35
+
36 36
     When I open the coverage report generated with `bundle exec rspec spec`
37 37
     Then the report should be based upon:
38 38
       | RSpec |
8  features/config_project_name.feature
@@ -14,16 +14,16 @@ Feature:
14 14
       require 'simplecov'
15 15
       SimpleCov.start
16 16
       """
17  
-      
  17
+
18 18
     When I open the coverage report generated with `bundle exec rake test`
19 19
     Then I should see "Code coverage for Project"
20  
-  
  20
+
21 21
   Scenario: Custom name
22 22
     Given a file named "test/simplecov_config.rb" with:
23 23
       """
24 24
       require 'simplecov'
25 25
       SimpleCov.start { project_name "Superfancy 2.0" }
26 26
       """
27  
-    
  27
+
28 28
     When I open the coverage report generated with `bundle exec rake test`
29  
-    Then I should see "Code coverage for Superfancy 2.0"
  29
+    Then I should see "Code coverage for Superfancy 2.0"
28  features/config_styles.feature
@@ -2,7 +2,7 @@
2 2
 Feature:
3 3
 
4 4
   There's several ways to configure SimpleCov. All of those
5  
-  config schemes below are equivalent and can be chosen by personal 
  5
+  config schemes below are equivalent and can be chosen by personal
6 6
   preference or project requirements.
7 7
 
8 8
   Background:
@@ -20,11 +20,11 @@ Feature:
20 20
         command_name 'Config Test Runner'
21 21
       end
22 22
       """
23  
-      
  23
+
24 24
     When I open the coverage report generated with `bundle exec rake test`
25 25
     Then I should see "4 files in total."
26 26
     And I should see "using Config Test Runner" within "#footer"
27  
-  
  27
+
28 28
   Scenario: Explicitly before start block
29 29
     Given a file named ".simplecov" with:
30 30
       """
@@ -32,11 +32,11 @@ Feature:
32 32
       SimpleCov.command_name 'Config Test Runner'
33 33
       SimpleCov.start
34 34
       """
35  
-    
  35
+
36 36
     When I open the coverage report generated with `bundle exec rake test`
37 37
     Then I should see "4 files in total."
38 38
     And I should see "using Config Test Runner" within "#footer"
39  
-  
  39
+
40 40
   Scenario: Explicitly after start block
41 41
     Given a file named ".simplecov" with:
42 42
       """
@@ -44,11 +44,11 @@ Feature:
44 44
       SimpleCov.add_filter 'test'
45 45
       SimpleCov.command_name 'Config Test Runner'
46 46
       """
47  
-    
  47
+
48 48
     When I open the coverage report generated with `bundle exec rake test`
49 49
     Then I should see "4 files in total."
50  
-    And I should see "using Config Test Runner" within "#footer"  
51  
-    
  50
+    And I should see "using Config Test Runner" within "#footer"
  51
+
52 52
   Scenario: Using configure block after start
53 53
     Given a file named ".simplecov" with:
54 54
       """
@@ -58,11 +58,11 @@ Feature:
58 58
         command_name 'Config Test Runner'
59 59
       end
60 60
       """
61  
-    
  61
+
62 62
     When I open the coverage report generated with `bundle exec rake test`
63 63
     Then I should see "4 files in total."
64 64
     And I should see "using Config Test Runner" within "#footer"
65  
-  
  65
+
66 66
   Scenario: Using configure block before start
67 67
     Given a file named ".simplecov" with:
68 68
       """
@@ -72,11 +72,11 @@ Feature:
72 72
       end
73 73
       SimpleCov.start
74 74
       """
75  
-    
  75
+
76 76
     When I open the coverage report generated with `bundle exec rake test`
77 77
     Then I should see "4 files in total."
78 78
     And I should see "using Config Test Runner" within "#footer"
79  
-    
  79
+
80 80
   Scenario: Mixing configure and start block config
81 81
     Given a file named ".simplecov" with:
82 82
       """
@@ -87,8 +87,8 @@ Feature:
87 87
         add_filter 'test'
88 88
       end
89 89
       """
90  
-  
  90
+
91 91
     When I open the coverage report generated with `bundle exec rake test`
92 92
     Then I should see "4 files in total."
93 93
     And I should see "using Config Test Runner" within "#footer"
94  
-  
  94
+
10  features/cucumber_basic.feature
... ...
@@ -1,7 +1,7 @@
1 1
 @cucumber
2 2
 Feature:
3 3
 
4  
-  Simply adding the basic simplecov lines to a project should get 
  4
+  Simply adding the basic simplecov lines to a project should get
5 5
   the user a coverage report after running `cucumber features`
6 6
 
7 7
   Scenario:
@@ -11,12 +11,12 @@ Feature:
11 11
       require 'simplecov'
12 12
       SimpleCov.start
13 13
       """
14  
-      
  14
+
15 15
     When I open the coverage report generated with `bundle exec cucumber features`
16 16
     Then I should see the groups:
17 17
       | name      | coverage | files |
18 18
       | All Files | 91.38%   | 6     |
19  
-      
  19
+
20 20
     And I should see the source files:
21 21
       | name                                    | coverage |
22 22
       | lib/faked_project.rb                    | 100.0 %  |
@@ -25,6 +25,6 @@ Feature:
25 25
       | lib/faked_project/meta_magic.rb         | 100.0 %  |
26 26
       | features/step_definitions/my_steps.rb   | 100.0 %  |
27 27
       | features/support/simplecov_config.rb    | 100.0 %  |
28  
-      
  28
+
29 29
     And the report should be based upon:
30  
-      | Cucumber Features |
  30
+      | Cucumber Features |
10  features/merging_test_unit_and_rspec.feature
@@ -23,23 +23,23 @@ Feature:
23 23
         add_filter 'spec.rb'
24 24
       end
25 25
       """
26  
-      
  26
+
27 27
     When I open the coverage report generated with `bundle exec rake test`
28 28
     Then the report should be based upon:
29 29
       | Unit Tests |
30  
-    
  30
+
31 31
     When I open the coverage report generated with `bundle exec rspec spec`
32 32
     Then the report should be based upon:
33 33
       | RSpec      |
34 34
       | Unit Tests |
35  
-      
  35
+
36 36
     And I should see the groups:
37 37
       | name      | coverage | files |
38 38
       | All Files | 90.7%    | 4     |
39  
-      
  39
+
40 40
     And I should see the source files:
41 41
       | name                                    | coverage |
42 42
       | lib/faked_project.rb                    | 100.0 %  |
43 43
       | lib/faked_project/some_class.rb         |  80.0 %  |
44 44
       | lib/faked_project/framework_specific.rb |  87.5 %  |
45  
-      | lib/faked_project/meta_magic.rb         | 100.0 %  |
  45
+      | lib/faked_project/meta_magic.rb         | 100.0 %  |
8  features/rspec_basic.feature
... ...
@@ -1,7 +1,7 @@
1 1
 @rspec
2 2
 Feature:
3 3
 
4  
-  Simply adding the basic simplecov lines to a project should get 
  4
+  Simply adding the basic simplecov lines to a project should get
5 5
   the user a coverage report after running `rspec`
6 6
 
7 7
   Scenario:
@@ -11,12 +11,12 @@ Feature:
11 11
       require 'simplecov'
12 12
       SimpleCov.start
13 13
       """
14  
-      
  14
+
15 15
     When I open the coverage report generated with `bundle exec rspec spec`
16 16
     Then I should see the groups:
17 17
       | name      | coverage | files |
18 18
       | All Files | 90.91%   | 6     |
19  
-      
  19
+
20 20
     And I should see the source files:
21 21
       | name                                    | coverage |
22 22
       | lib/faked_project.rb                    | 100.0 %  |
@@ -25,7 +25,7 @@ Feature:
25 25
       | lib/faked_project/meta_magic.rb         | 100.0 %  |
26 26
       | spec/meta_magic_spec.rb                 | 100.0 %  |
27 27
       | spec/some_class_spec.rb                 | 100.0 %  |
28  
-      
  28
+
29 29
       # Note: faked_spec.rb is not appearing here since that's the first unit test file
30 30
       # loaded by Rake, and only there test_helper is required, which then loads simplecov
31 31
       # and triggers tracking of all other loaded files! Solution for this would be to
6  features/rspec_groups_and_filters_basic.feature
@@ -14,17 +14,17 @@ Feature:
14 14
         add_filter '/spec/'
15 15
       end
16 16
       """
17  
-      
  17
+
18 18
     When I open the coverage report generated with `bundle exec rspec spec`
19 19
     And I should see the groups:
20 20
       | name      | coverage | files |
21 21
       | All Files | 88.37%   | 4     |
22 22
       | Libs      | 86.11%   | 3     |
23 23
       | Ungrouped | 100.0%   | 1     |
24  
-      
  24
+
25 25
     And I should see the source files:
26 26
       | name                                    | coverage |
27 27
       | lib/faked_project.rb                    | 100.0 %  |
28 28
       | lib/faked_project/some_class.rb         | 80.0 %  |
29 29
       | lib/faked_project/framework_specific.rb | 75.0 %   |
30  
-      | lib/faked_project/meta_magic.rb         | 100.0 %  |
  30
+      | lib/faked_project/meta_magic.rb         | 100.0 %  |
4  features/rspec_groups_and_filters_complex.feature
@@ -5,7 +5,7 @@ Feature: Sophisticated grouping and filtering on RSpec
5 5
   Blocks get each SimpleCov::SourceFile instance passed an can use arbitrary
6 6
   and potentially weird conditions to remove files from the report or add them
7 7
   to specific groups.
8  
-  
  8
+
9 9
   Scenario:
10 10
     Given I cd to "project"
11 11
     Given a file named "spec/simplecov_config.rb" with:
@@ -33,4 +33,4 @@ Feature: Sophisticated grouping and filtering on RSpec
33 33
 
34 34
     And I should see the source files:
35 35
       | name                            | coverage |
36  
-      | lib/faked_project/meta_magic.rb | 100.0 %  |
  36
+      | lib/faked_project/meta_magic.rb | 100.0 %  |
4  features/rspec_without_simplecov.feature
@@ -9,7 +9,7 @@ Feature:
9 9
   Scenario: No config at all
10 10
     When I successfully run `bundle exec rspec spec`
11 11
     Then no coverage report should have been generated
12  
-    
  12
+
13 13
   Scenario: Configured, but not started
14 14
     Given a file named "spec/simplecov_config.rb" with:
15 15
       """
@@ -20,4 +20,4 @@ Feature:
20 20
       """
21 21
 
22 22
     When I successfully run `bundle exec rspec spec`
23  
-    Then no coverage report should have been generated
  23
+    Then no coverage report should have been generated
6  features/step_definitions/html_steps.rb
@@ -2,7 +2,7 @@ module GroupHelpers
2 2
   def available_groups
3 3
     all('#content .file_list_container')
4 4
   end
5  
-  
  5
+
6 6
   def available_source_files
7 7
     all('.source_files .source_table')
8 8
   end
@@ -21,7 +21,7 @@ def available_source_files
21 21
     with_scope "#content ##{group["name"].gsub(/[^a-z]/i, '')}.file_list_container" do
22 22
       file_count_in_group = page.all('a.src_link').count
23 23
       file_count_in_group.should == group["files"].to_i
24  
-      
  24
+
25 25
       with_scope "h2" do
26 26
         page.should have_content(group["name"])
27 27
         page.should have_content(group["coverage"])
@@ -33,7 +33,7 @@ def available_source_files
33 33
 Then /^I should see the source files:$/ do |table|
34 34
   expected_files = table.hashes
35 35
   expected_files.length.should == available_source_files.count
36  
-  
  36
+
37 37
   # Find all filenames and their coverage present in coverage report
38 38
   files = available_source_files.map {|f| {"name" => f.find('h3').text, "coverage" => f.find('.header span').text} }
39 39
 
2  features/step_definitions/simplecov_steps.rb
@@ -25,7 +25,7 @@
25 25
     And the following files should not exist:
26 26
       | #{coverage_dir}/index.html      |
27 27
       | #{coverage_dir}/.resultset.json |
28  
-  } 
  28
+  }
29 29
 end
30 30
 
31 31
 Then /^the report should be based upon:$/ do |table|
2  features/step_definitions/transformers.rb
@@ -10,4 +10,4 @@
10 10
   files = nil # Avoid shadowing
11 11
   in_current_dir { files = Dir['spec/**/*_spec.rb'] }
12 12
   "bundle exec rspec #{files.sort.join(' ')}"
13  
-end
  13
+end
2  features/step_definitions/web_steps.rb
@@ -61,4 +61,4 @@ def with_scope(locator)
61 61
 
62 62
 Then /^print the page$/ do
63 63
   puts page.body
64  
-end
  64
+end
6  features/support/env.rb
@@ -10,8 +10,8 @@
10 10
 require 'capybara/cucumber'
11 11
 
12 12
 # Fake rack app for capybara that just returns the latest coverage report from aruba temp project dir
13  
-Capybara.app = lambda {|env| 
14  
-  [200, {'Content-Type' => 'text/html'}, 
  13
+Capybara.app = lambda {|env|
  14
+  [200, {'Content-Type' => 'text/html'},
15 15
     [File.read(File.join(File.dirname(__FILE__), '../../tmp/aruba/project', 'coverage/index.html'))]]
16 16
 }
17 17
 
@@ -23,4 +23,4 @@
23 23
     FileUtils.rm_rf 'project'
24 24
     FileUtils.cp_r File.join(this_dir, '../../test/faked_project/'), 'project'
25 25
   end
26  
-end
  26
+end
10  features/test_unit_basic.feature
... ...
@@ -1,7 +1,7 @@
1 1
 @test_unit
2 2
 Feature:
3 3
 
4  
-  Simply adding the basic simplecov lines to a project should get 
  4
+  Simply adding the basic simplecov lines to a project should get
5 5
   the user a coverage report after running `rake test`
6 6
 
7 7
   Scenario:
@@ -11,12 +11,12 @@ Feature:
11 11
       require 'simplecov'
12 12
       SimpleCov.start
13 13
       """
14  
-      
  14
+
15 15
     When I open the coverage report generated with `bundle exec rake test`
16 16
     Then I should see the groups:
17 17
       | name      | coverage | files |
18 18
       | All Files | 91.53%   | 6     |
19  
-      
  19
+
20 20
     And I should see the source files:
21 21
       | name                                    | coverage |
22 22
       | lib/faked_project.rb                    | 100.0 %  |
@@ -25,11 +25,11 @@ Feature:
25 25
       | lib/faked_project/meta_magic.rb         | 100.0 %  |
26 26
       | test/meta_magic_test.rb                 | 100.0 %  |
27 27
       | test/some_class_test.rb                 | 100.0 %  |
28  
-      
  28
+
29 29
       # Note: faked_test.rb is not appearing here since that's the first unit test file
30 30
       # loaded by Rake, and only there test_helper is required, which then loads simplecov
31 31
       # and triggers tracking of all other loaded files! Solution for this would be to
32 32
       # configure simplecov in this first test instead of test_helper.
33 33
 
34 34
     And the report should be based upon:
35  
-      | Unit Tests |
  35
+      | Unit Tests |
6  features/test_unit_groups_and_filters_basic.feature
@@ -14,17 +14,17 @@ Feature:
14 14
         add_filter '/test/'
15 15
       end
16 16
       """
17  
-      
  17
+
18 18
     When I open the coverage report generated with `bundle exec rake test`
19 19
     Then I should see the groups:
20 20
       | name      | coverage | files |
21 21
       | All Files | 88.37%   | 4     |
22 22
       | Libs      | 86.11%   | 3     |
23 23
       | Ungrouped | 100.0%   | 1     |
24  
-      
  24
+
25 25
     And I should see the source files:
26 26
       | name                                    | coverage |
27 27
       | lib/faked_project.rb                    | 100.0 %  |
28 28
       | lib/faked_project/some_class.rb         |  80.0 %  |
29 29
       | lib/faked_project/framework_specific.rb |  75.0 %  |
30  
-      | lib/faked_project/meta_magic.rb         | 100.0 %  |
  30
+      | lib/faked_project/meta_magic.rb         | 100.0 %  |
4  features/test_unit_groups_and_filters_complex.feature
@@ -6,7 +6,7 @@ Feature: Sophisticated grouping and filtering on Test/Unit
6 6
   and potentially weird conditions to remove files from the report or add them
7 7
   to specific groups.
8 8
 
9  
-  Scenario: 
  9
+  Scenario:
10 10
     Given I cd to "project"
11 11
     Given a file named "test/simplecov_config.rb" with:
12 12
       """
@@ -33,4 +33,4 @@ Feature: Sophisticated grouping and filtering on Test/Unit
33 33
 
34 34
     And I should see the source files:
35 35
       | name                            | coverage |
36  
-      | lib/faked_project/meta_magic.rb | 100.0 %  |
  36
+      | lib/faked_project/meta_magic.rb | 100.0 %  |
4  features/test_unit_without_simplecov.feature
@@ -9,7 +9,7 @@ Feature:
9 9
   Scenario: No config at all
10 10
     When I successfully run `bundle exec rake test`
11 11
     Then no coverage report should have been generated
12  
-    
  12
+
13 13
   Scenario: Configured, but not started
14 14
     Given a file named "test/simplecov_config.rb" with:
15 15
       """
@@ -20,4 +20,4 @@ Feature:
20 20
       """
21 21
 
22 22
     When I successfully run `bundle exec rake test`
23  
-    Then no coverage report should have been generated
  23
+    Then no coverage report should have been generated
20  lib/simplecov.rb
@@ -6,10 +6,10 @@
6 6
 module SimpleCov
7 7
   # Indicates invalid coverage data
8 8
   class CoverageDataError < StandardError; end;
9  
-  
  9
+
10 10
   class << self
11 11
     attr_accessor :running#, :result # TODO: Remove result?
12  
-    
  12
+
13 13
     #
14 14
     # Sets up SimpleCov to run against your project.
15 15
     # You can optionally specify an adapter to use as well as configuration with a block:
@@ -29,7 +29,7 @@ class << self
29 29
     #
30 30
     def start(adapter=nil, &block)
31 31
       return false unless SimpleCov.usable?
32  
-      
  32
+
33 33
       require 'coverage'
34 34
       load_adapter(adapter) unless adapter.nil?
35 35
       Coverage.start
@@ -37,7 +37,7 @@ def start(adapter=nil, &block)
37 37
       @result = nil
38 38
       self.running = true
39 39
     end
40  
-    
  40
+
41 41
     #
42 42
     # Returns the result for the current coverage run, merging it across test suites
43 43
     # from cache using SimpleCov::ResultMerger if use_merging is activated (default)
@@ -55,7 +55,7 @@ def result
55 55
     ensure
56 56
       self.running = false
57 57
     end
58  
-    
  58
+
59 59
     #
60 60
     # Applies the configured filters to the given array of SimpleCov::SourceFile items
61 61
     #
@@ -66,7 +66,7 @@ def filtered(files)
66 66
       end
67 67
       SimpleCov::FileList.new result
68 68
     end
69  
-    
  69
+
70 70
     #
71 71
     # Applies the configured groups to the given array of SimpleCov::SourceFile items
72 72
     #
@@ -82,14 +82,14 @@ def grouped(files)
82 82
       end
83 83
       grouped
84 84
     end
85  
-    
86  
-    # 
  85
+
  86
+    #
87 87
     # Applies the adapter of given name on SimpleCov configuration
88 88
     #
89 89
     def load_adapter(name)
90 90
       adapters.load(name)
91 91
     end
92  
-    
  92
+
93 93
     #
94 94
     # Checks whether we're on a proper version of ruby (1.9+) and returns false if this is not the case,
95 95
     # also printing an appropriate warning
@@ -122,4 +122,4 @@ def usable?