simplecov 0.8.2 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -0
- data/.travis.yml +10 -17
- data/Appraisals +1 -1
- data/CHANGELOG.md +57 -15
- data/Gemfile +3 -3
- data/README.md +38 -15
- data/features/config_formatters.feature +25 -0
- data/features/rspec_basic.feature +1 -1
- data/features/rspec_groups_using_filter_class.feature +1 -1
- data/features/step_definitions/html_steps.rb +7 -7
- data/features/step_definitions/web_steps.rb +4 -4
- data/gemfiles/multi_json_legacy.gemfile +4 -4
- data/gemfiles/multi_json_new.gemfile +4 -4
- data/lib/simplecov/command_guesser.rb +5 -5
- data/lib/simplecov/configuration.rb +19 -0
- data/lib/simplecov/defaults.rb +10 -4
- data/lib/simplecov/file_list.rb +5 -3
- data/lib/simplecov/formatter/multi_formatter.rb +22 -19
- data/lib/simplecov/formatter/simple_formatter.rb +16 -12
- data/lib/simplecov/result_merger.rb +11 -5
- data/lib/simplecov/source_file.rb +8 -7
- data/lib/simplecov/version.rb +2 -2
- data/simplecov.gemspec +5 -4
- data/test/faked_project/features/step_definitions/my_steps.rb +9 -9
- data/test/faked_project/spec/faked_spec.rb +2 -2
- data/test/faked_project/spec/meta_magic_spec.rb +8 -3
- data/test/faked_project/spec/some_class_spec.rb +5 -2
- data/test/fixtures/frameworks/rspec_bad.rb +1 -1
- data/test/fixtures/frameworks/rspec_good.rb +1 -1
- metadata +45 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27181f8ed46248f7ebe05af087db2c6943824f83
|
4
|
+
data.tar.gz: 1457804d5cbd433e7c5f7b99a9b2f62c9e1c0f76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50f425070a5b073e7f2a26cb7dda9582cec71d9f4db4c3b50f0c13ecea000f26e6d3b6206d3978aed1ffabdc7f566b72279b1f050d648f0be4390d346787d820
|
7
|
+
data.tar.gz: 1ddc40490eb2c85454083fba35b1fb265f69093ba96ab2a4f5f5562d10c660564de374a656f9b8216ec30bdc11113bf20d8950845fdb315f60dd9fc0b70391cc
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--require rspec/legacy_formatters
|
data/.travis.yml
CHANGED
@@ -1,27 +1,20 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
-
|
5
|
-
- rake appraisal:install
|
6
|
-
- rake appraisal
|
1
|
+
language: ruby
|
2
|
+
gemfile:
|
3
|
+
- gemfiles/multi_json_legacy.gemfile
|
4
|
+
- gemfiles/multi_json_new.gemfile
|
7
5
|
rvm:
|
8
|
-
- ree
|
9
|
-
- 1.8.7
|
10
|
-
- 1.9.2
|
11
6
|
- 1.9.3
|
12
7
|
- 2.0.0
|
13
|
-
-
|
14
|
-
- rbx-19mode
|
15
|
-
# - jruby-18mode
|
16
|
-
# - jruby-19mode
|
17
|
-
# - jruby-head
|
8
|
+
- 2.1
|
18
9
|
- ruby-head
|
10
|
+
- jruby
|
11
|
+
- rbx-2
|
19
12
|
matrix:
|
20
13
|
allow_failures:
|
21
14
|
- rvm: ruby-head
|
22
|
-
- rvm: jruby
|
23
|
-
- rvm:
|
24
|
-
|
15
|
+
- rvm: jruby
|
16
|
+
- rvm: rbx-2
|
17
|
+
fast_finish: true
|
25
18
|
notifications:
|
26
19
|
email:
|
27
20
|
on_success: always
|
data/Appraisals
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,15 +1,57 @@
|
|
1
|
-
Unreleased ([changes](https://github.com/colszowka/simplecov/compare/v0.
|
1
|
+
Unreleased ([changes](https://github.com/colszowka/simplecov/compare/v0.9.0...master))
|
2
2
|
====================
|
3
3
|
|
4
|
+
## Enhancements
|
5
|
+
|
6
|
+
|
7
|
+
## Bugfixes
|
8
|
+
|
9
|
+
|
10
|
+
0.9.0, 2014-07-17 ([changes](https://github.com/colszowka/simplecov/compare/v0.8.2...v0.9.0))
|
11
|
+
====================
|
12
|
+
|
13
|
+
**A warm welcome and big thank you to the new contributors [@xaviershay](https://github.com/xaviershay), [@sferik](https://github.com/sferik) and especially [@bf4](https://github.com/bf4) for tackling a whole lot of issues and pull requests for this release!**
|
14
|
+
|
15
|
+
## Enhancements
|
16
|
+
|
17
|
+
* New interface to specify multiple formatters.
|
18
|
+
See [#317](https://github.com/colszowka/simplecov/pull/317) (thanks @sferik)
|
19
|
+
* Document in the README how to exclude code from coverage reports,
|
20
|
+
and that the feature shouldn't be abused for skipping untested
|
21
|
+
private code.
|
22
|
+
See [#304](https://github.com/colszowka/simplecov/issues/304)
|
23
|
+
* Clarify Ruby version support.
|
24
|
+
See [#279](https://github.com/colszowka/simplecov/pull/279) (thanks @deivid-rodriguez)
|
25
|
+
|
26
|
+
## Bugfixes
|
27
|
+
|
28
|
+
* Ensure calculations return Floats, not Fixnum or Rational. Fixes segfaults with mathn.
|
29
|
+
See [#245](https://github.com/colszowka/simplecov/pull/245) (thanks to @bf4)
|
30
|
+
* Using `Kernel.exit` instead of exit to avoid uncaught throw :IRB_EXIT when
|
31
|
+
exiting irb sessions.
|
32
|
+
See [#287](https://github.com/colszowka/simplecov/pull/287) (thanks @wless1)
|
33
|
+
See [#285](https://github.com/colszowka/simplecov/issues/285)
|
34
|
+
* Does not look for .simplecov in ~/ when $HOME is not set.
|
35
|
+
See [#311](https://github.com/colszowka/simplecov/pull/311) (thanks @lasseebert)
|
36
|
+
* Exit with code only if it's Numeric > 0.
|
37
|
+
See [#302](https://github.com/colszowka/simplecov/pull/303)(thanks @hajder)
|
38
|
+
* Make default filter case insensitive.
|
39
|
+
See [#280](https://github.com/colszowka/simplecov/pull/280) (thanks @ryanatball)
|
40
|
+
* Improve regexp that matches functional tests.
|
41
|
+
See [#276](https://github.com/colszowka/simplecov/pull/276) (thanks @sferik)
|
42
|
+
* Fix TravisCI [#272](https://github.com/colszowka/simplecov/pull/272) [#278](https://github.com/colszowka/simplecov/pull/278), [#302](https://github.com/colszowka/simplecov/pull/302)
|
43
|
+
* Fix global config load.
|
44
|
+
See [#311](https://github.com/colszowka/simplecov/pull/311) (thanks @lasseebert)
|
45
|
+
|
4
46
|
v0.8.2, 2013-11-20 ([changes](https://github.com/colszowka/simplecov/compare/v0.8.1...v0.8.2))
|
5
47
|
=====================
|
6
48
|
|
7
49
|
## Bugfixes
|
8
50
|
|
9
|
-
* Replaced the locking behaviour [via lockfile gem](https://github.com/colszowka/simplecov/pull/185) with
|
10
|
-
plain Ruby explicit file locking when merging results. This should make simplecov merging to behave well
|
11
|
-
on Windows again.
|
12
|
-
See [#258](https://github.com/colszowka/simplecov/issues/258) and
|
51
|
+
* Replaced the locking behaviour [via lockfile gem](https://github.com/colszowka/simplecov/pull/185) with
|
52
|
+
plain Ruby explicit file locking when merging results. This should make simplecov merging to behave well
|
53
|
+
on Windows again.
|
54
|
+
See [#258](https://github.com/colszowka/simplecov/issues/258) and
|
13
55
|
[#223](https://github.com/colszowka/simplecov/pull/223) (thanks to @tomykaira)
|
14
56
|
|
15
57
|
v0.8.1, 2013-11-10 ([changes](https://github.com/colszowka/simplecov/compare/v0.8.0...v0.8.1))
|
@@ -32,7 +74,7 @@ quite stable in most circumstances. This release brings various further stabilit
|
|
32
74
|
(especially when working with parallel_tests), the configuration, source file encodings, and command name guessing.
|
33
75
|
|
34
76
|
The 0.8 line is the last one to cooperate with Ruby < 1.9. Starting with 0.9, SimpleCov will assume to be running in
|
35
|
-
Ruby 1.9+, and will not try to detect or bail silently on older Ruby versions. An appropriate deprecation warning
|
77
|
+
Ruby 1.9+, and will not try to detect or bail silently on older Ruby versions. An appropriate deprecation warning
|
36
78
|
has been added.
|
37
79
|
|
38
80
|
## Features
|
@@ -41,11 +83,11 @@ has been added.
|
|
41
83
|
See [#238](https://github.com/colszowka/simplecov/pull/238) (thanks to @ms-tg)
|
42
84
|
* You can now have a global `~/.simplecov` configuration file.
|
43
85
|
See [#195](https://github.com/colszowka/simplecov/pull/195) (thanks to @spagalloco)
|
44
|
-
* simplecov-html now uses the MIT-licensed colorbox plugin. Some adjustments when viewing source files,
|
86
|
+
* simplecov-html now uses the MIT-licensed colorbox plugin. Some adjustments when viewing source files,
|
45
87
|
including retaining the currently open file on refresh have been added.
|
46
88
|
See [simplecov-html #15](https://github.com/colszowka/simplecov-html/pull/15) (thanks to @chetan)
|
47
89
|
* Adds support for Rails 4 command guessing, removes default group `vendor/plugins`.
|
48
|
-
See [#181](https://github.com/colszowka/simplecov/pull/181) and
|
90
|
+
See [#181](https://github.com/colszowka/simplecov/pull/181) and
|
49
91
|
[#203](https://github.com/colszowka/simplecov/pull/203) (thanks to @semanticart and @phallstrom)
|
50
92
|
* You can now load simplecov without the default settings by doing `require 'simplecov/no_defaults'`
|
51
93
|
or setting `ENV['SIMPLECOV_NO_DEFAULTS']`. Check `simplecov/defaults` to see what preconfigurations are getting
|
@@ -53,13 +95,13 @@ has been added.
|
|
53
95
|
* The result set merging now uses the `lockfile` gem to avoid race conditions.
|
54
96
|
See [#185](https://github.com/colszowka/simplecov/pull/185) (thanks to @jshraibman-mdsol).
|
55
97
|
* Automatically detect the usage of parallel_tests and adjust the command name with the test env number accordingly,
|
56
|
-
See [#64](https://github.com/colszowka/simplecov/issues/64) and
|
98
|
+
See [#64](https://github.com/colszowka/simplecov/issues/64) and
|
57
99
|
[#185](https://github.com/colszowka/simplecov/pull/185) (thanks to @jshraibman-mdsol).
|
58
100
|
|
59
101
|
## Enhancements
|
60
102
|
|
61
103
|
* Rename adapters to "profiles" given that they are bundles of settings. The old adapter methods are
|
62
|
-
deprecated, but remain available for now.
|
104
|
+
deprecated, but remain available for now.
|
63
105
|
See [#207](https://github.com/colszowka/simplecov/pull/207) (thanks to @mikerobe)
|
64
106
|
* Tweaks to the automatic test suite naming. In particular, `rspec/features` should now
|
65
107
|
be correctly attributed to RSpec, not Cucumber.
|
@@ -67,7 +109,7 @@ has been added.
|
|
67
109
|
* MiniTest should now be identified correctly by the command name guesser.
|
68
110
|
See [#244](https://github.com/colszowka/simplecov/pull/244) (thanks to @envygeeks)
|
69
111
|
* Makes SimpleCov resilient to inclusion of mathn library.
|
70
|
-
See [#175](https://github.com/colszowka/simplecov/pull/175) and
|
112
|
+
See [#175](https://github.com/colszowka/simplecov/pull/175) and
|
71
113
|
[#140](https://github.com/colszowka/simplecov/issues/140) (thanks to @scotje)
|
72
114
|
* Allow coverage_dir to be an absolute path.
|
73
115
|
* See [#190](https://github.com/colszowka/simplecov/pull/190) (thanks to @jshraibman-mdsol)
|
@@ -76,7 +118,7 @@ has been added.
|
|
76
118
|
* Work-arounds for the Coverage library shipped in JRuby 1.6 to behave in line with MRI.
|
77
119
|
See [#174](https://github.com/colszowka/simplecov/pull/174) (thanks to @grddev)
|
78
120
|
* Fix warning: instance variable @exit_status not initialized.
|
79
|
-
See [#242](https://github.com/colszowka/simplecov/pull/242) and
|
121
|
+
See [#242](https://github.com/colszowka/simplecov/pull/242) and
|
80
122
|
[#213](https://github.com/colszowka/simplecov/pull/213) (thanks to @sferik and @infertux)
|
81
123
|
|
82
124
|
## Bugfixes
|
@@ -84,13 +126,13 @@ has been added.
|
|
84
126
|
* Correct result calculations for people using :nocov: tags.
|
85
127
|
See [#215](https://github.com/colszowka/simplecov/pull/215) (thanks to @aokolish)
|
86
128
|
* Average hits per line for groups of files is now computed correctly.
|
87
|
-
See [#192](http://github.com/colszowka/simplecov/pull/192) and
|
129
|
+
See [#192](http://github.com/colszowka/simplecov/pull/192) and
|
88
130
|
[#179](http://github.com/colszowka/simplecov/issues/179) (thanks to @graysonwright)
|
89
131
|
* Compatability with BINARY internal encoding.
|
90
|
-
See [#194](https://github.com/colszowka/simplecov/pull/194) and
|
132
|
+
See [#194](https://github.com/colszowka/simplecov/pull/194) and
|
91
133
|
[#127](https://github.com/colszowka/simplecov/issues/127) (thanks to @justfalter)
|
92
134
|
* Special characters in `SimpleCov.root` are now correctly escaped before being used as a RegExp.
|
93
|
-
See [#204](https://github.com/colszowka/simplecov/issues/204) and
|
135
|
+
See [#204](https://github.com/colszowka/simplecov/issues/204) and
|
94
136
|
[#237](https://github.com/colszowka/simplecov/pull/237) (thanks to @rli9)
|
95
137
|
|
96
138
|
v0.7.1, 2012-10-12 ([changes](https://github.com/colszowka/simplecov/compare/v0.7.0...v0.7.1))
|
data/Gemfile
CHANGED
@@ -2,11 +2,11 @@ source "https://rubygems.org"
|
|
2
2
|
gemspec
|
3
3
|
|
4
4
|
if 'Integration test (cucumber) suite is 1.9+ only'.respond_to? :encoding
|
5
|
-
gem 'aruba', '~> 0.
|
5
|
+
gem 'aruba', '~> 0.6'
|
6
6
|
gem 'capybara', '~> 2.0'
|
7
7
|
gem 'poltergeist', '~> 1.1.0'
|
8
|
-
gem 'phantomjs', '~> 1.
|
9
|
-
gem 'cucumber', '
|
8
|
+
gem 'phantomjs', '~> 1.9'
|
9
|
+
gem 'cucumber', '~> 1.1'
|
10
10
|
end
|
11
11
|
|
12
12
|
# shoulda-matchers depends on rails >= 4, but that does not work with Ruby < 1.9. So, to allow CI builds on those versions,
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
SimpleCov [![Build Status](https://secure.travis-ci.org/colszowka/simplecov.png)][Continuous Integration] [![Dependency Status](https://gemnasium.com/colszowka/simplecov.png)][Dependencies] [![Code Climate](https://codeclimate.com/github/colszowka/simplecov.png)](https://codeclimate.com/github/colszowka/simplecov)
|
1
|
+
SimpleCov [![Build Status](https://secure.travis-ci.org/colszowka/simplecov.png)][Continuous Integration] [![Dependency Status](https://gemnasium.com/colszowka/simplecov.png)][Dependencies] [![Code Climate](https://codeclimate.com/github/colszowka/simplecov.png)](https://codeclimate.com/github/colszowka/simplecov) [![Inline docs](http://inch-ci.org/github/colszowka/simplecov.png)](http://inch-ci.org/github/colszowka/simplecov)
|
2
2
|
=========
|
3
|
-
**Code coverage for Ruby
|
3
|
+
**Code coverage for Ruby**
|
4
4
|
|
5
5
|
* [Source Code]
|
6
6
|
* [API documentation]
|
@@ -9,7 +9,9 @@ SimpleCov [![Build Status](https://secure.travis-ci.org/colszowka/simplecov.png)
|
|
9
9
|
* [Mailing List]
|
10
10
|
* [Continuous Integration]
|
11
11
|
|
12
|
-
[
|
12
|
+
**Important Notice: There is a bug that affects exit code handling on the 0.8 line of SimpleCov, see [#281](https://github.com/colszowka/simplecov/issues/281). Please use versions `~> 0.7.1` or `~> 0.9.0` to avoid this.**
|
13
|
+
|
14
|
+
[Coverage]: http://www.ruby-doc.org/stdlib-2.1.0/libdoc/coverage/rdoc/Coverage.html "API doc for Ruby's Coverage library"
|
13
15
|
[Source Code]: https://github.com/colszowka/simplecov "Source Code @ GitHub"
|
14
16
|
[API documentation]: http://rubydoc.info/gems/simplecov/frames "RDoc API Documentation at Rubydoc.info"
|
15
17
|
[Configuration]: http://rubydoc.info/gems/simplecov/SimpleCov/Configuration "Configuration options API documentation"
|
@@ -23,7 +25,7 @@ SimpleCov [![Build Status](https://secure.travis-ci.org/colszowka/simplecov.png)
|
|
23
25
|
|
24
26
|
[![You can support the development of SimpleCov via Pledgie - thanks for your help](https://pledgie.com/campaigns/18379.png?skin_name=chrome)][Pledgie]
|
25
27
|
|
26
|
-
SimpleCov is a code coverage analysis tool for Ruby
|
28
|
+
SimpleCov is a code coverage analysis tool for Ruby. It uses [ruby's built-in Coverage][Coverage] library to gather code
|
27
29
|
coverage data, but makes processing its results much easier by providing a clean API to filter, group, merge, format
|
28
30
|
and display those results, thus giving you a complete code coverage suite that can be set up with just a couple lines of
|
29
31
|
code.
|
@@ -103,7 +105,7 @@ SimpleCov.start 'rails'
|
|
103
105
|
|
104
106
|
## Use it with any framework!
|
105
107
|
|
106
|
-
|
108
|
+
Similarly to the usage with Test::Unit described above, the only thing you have to do is to add the simplecov
|
107
109
|
config to the very top of your Cucumber/RSpec/whatever setup file.
|
108
110
|
|
109
111
|
Add the setup code to the **top** of `features/support/env.rb` (for Cucumber) or `spec/spec_helper.rb` (for RSpec).
|
@@ -142,8 +144,8 @@ to use SimpleCov with them. Here's an overview of the known ones:
|
|
142
144
|
<b>Spork</b>
|
143
145
|
</td>
|
144
146
|
<td>
|
145
|
-
Because of
|
146
|
-
with it, but that apparently
|
147
|
+
Because of how Spork works internally (using preforking) there used to be trouble when using SimpleCov
|
148
|
+
with it, but that has apparently been resolved with a specific configuration strategy. See
|
147
149
|
<a href="https://github.com/colszowka/simplecov/issues/42#issuecomment-4440284">this</a> comment.
|
148
150
|
</td>
|
149
151
|
<td>
|
@@ -243,7 +245,7 @@ end
|
|
243
245
|
## Filters
|
244
246
|
|
245
247
|
Filters can be used to remove selected files from your coverage data. By default, a filter is applied that removes all files
|
246
|
-
OUTSIDE of your project's root directory - otherwise you'd end up with
|
248
|
+
OUTSIDE of your project's root directory - otherwise you'd end up with billions of coverage reports for source files in the
|
247
249
|
gems you are using.
|
248
250
|
|
249
251
|
Of course you can define your own to remove things like configuration files, tests or whatever you don't need in your coverage
|
@@ -276,7 +278,7 @@ end
|
|
276
278
|
|
277
279
|
Block filters receive a SimpleCov::SourceFile instance and expect your block to return either true (if the file is to be removed
|
278
280
|
from the result) or false (if the result should be kept). Please check out the RDoc for SimpleCov::SourceFile to learn about the
|
279
|
-
methods available to you. In the above example, the filter will remove all files that have less
|
281
|
+
methods available to you. In the above example, the filter will remove all files that have less than 5 lines of code.
|
280
282
|
|
281
283
|
#### Custom filter class
|
282
284
|
|
@@ -294,6 +296,23 @@ Defining your own filters is pretty easy: Just inherit from SimpleCov::Filter an
|
|
294
296
|
the filter, a true return value from this method will result in the removal of the given source_file. The filter_argument method
|
295
297
|
is being set in the SimpleCov::Filter initialize method and thus is set to 5 in this example.
|
296
298
|
|
299
|
+
#### Ignoring/skipping code
|
300
|
+
|
301
|
+
You can exclude code from the coverage report by wrapping it in `# :nocov:`.
|
302
|
+
|
303
|
+
```ruby
|
304
|
+
# :nocov:
|
305
|
+
def skip_this_method
|
306
|
+
never_reached
|
307
|
+
end
|
308
|
+
# :nocov:
|
309
|
+
```
|
310
|
+
|
311
|
+
The name of the token can be changed to your liking. [Learn more about the nocov feature.][nocov]
|
312
|
+
[nocov]: https://github.com/colszowka/simplecov/blob/master/features/config_nocov_token.feature
|
313
|
+
|
314
|
+
**Note:** You shouldn't have to use the nocov token to skip private methods that are being included in your coverage. If you appropriately test the public interface of your classes and objects you should automatically get full coverage of your private methods.
|
315
|
+
|
297
316
|
## Default root filter and coverage for things outside of it
|
298
317
|
|
299
318
|
By default, SimpleCov filters everything outside of the `SimpleCov.root` directory. However, sometimes you may want
|
@@ -370,7 +389,7 @@ SimpleCov.command_name "test:integration"
|
|
370
389
|
SimpleCov.command_name "features"
|
371
390
|
```
|
372
391
|
|
373
|
-
Note that this has
|
392
|
+
Note that this only has to be invoked ONCE PER TEST SUITE, so even if you have 200 unit test files, specifying it in
|
374
393
|
some_test.rb is fair enough.
|
375
394
|
|
376
395
|
[simplecov-html] prints the used test suites in the footer of the generated coverage report.
|
@@ -393,7 +412,7 @@ it doesn't do your test speed any harm and you're always equipped with the lates
|
|
393
412
|
|
394
413
|
Because of this, SimpleCov has no explicit built-in mechanism to run coverage only on demand.
|
395
414
|
|
396
|
-
However, you can still accomplish this very easily by introducing
|
415
|
+
However, you can still accomplish this very easily by introducing an ENV variable conditional into your SimpleCov setup block, like this:
|
397
416
|
|
398
417
|
```ruby
|
399
418
|
SimpleCov.start if ENV["COVERAGE"]
|
@@ -514,10 +533,10 @@ being an instance of SimpleCov::Result. Do whatever your wish with that!
|
|
514
533
|
|
515
534
|
## Using multiple formatters
|
516
535
|
|
517
|
-
|
536
|
+
As for SimpleCov 0.9.0, you can specify multiple result formats:
|
518
537
|
|
519
538
|
```ruby
|
520
|
-
SimpleCov.
|
539
|
+
SimpleCov.formatters = [
|
521
540
|
SimpleCov::Formatter::HTMLFormatter,
|
522
541
|
SimpleCov::Formatter::CSVFormatter,
|
523
542
|
]
|
@@ -536,7 +555,7 @@ available:
|
|
536
555
|
#### [simplecov-csv](https://github.com/fguillen/simplecov-csv)
|
537
556
|
*by Fernando Guillen*
|
538
557
|
|
539
|
-
CSV formatter for SimpleCov
|
558
|
+
CSV formatter for SimpleCov
|
540
559
|
|
541
560
|
#### [cadre](https://github.com/nyarly/cadre)
|
542
561
|
*by Judson Lester*
|
@@ -567,7 +586,11 @@ including Rubinius and JRuby, in [Continuous Integration], but this happens only
|
|
567
586
|
test suite crash right now. Whether SimpleCov will support JRuby/Rubinius in the future depends solely on whether those Ruby
|
568
587
|
interpreters add the coverage library.
|
569
588
|
|
570
|
-
SimpleCov is built in [Continuous Integration] on 1.
|
589
|
+
SimpleCov is built in [Continuous Integration] on 1.9.3, 2.0.0, 2.1.0 and ruby-head.
|
590
|
+
|
591
|
+
## Want to find dead code in production?
|
592
|
+
|
593
|
+
Try [coverband](https://github.com/danmayer/coverband).
|
571
594
|
|
572
595
|
## Contributing
|
573
596
|
|
@@ -50,3 +50,28 @@ Feature:
|
|
50
50
|
When I successfully run `bundle exec rake test`
|
51
51
|
Then the output should contain "lib/faked_project/meta_magic.rb (coverage: 100.0%)"
|
52
52
|
And the output should match /Formatter [^\s]* failed with RuntimeError: Unable to format/
|
53
|
+
|
54
|
+
Scenario: With multiple formatters
|
55
|
+
Given SimpleCov for Test/Unit is configured with:
|
56
|
+
"""
|
57
|
+
require 'simplecov'
|
58
|
+
SimpleCov.formatters = [
|
59
|
+
SimpleCov::Formatter::SimpleFormatter,
|
60
|
+
Class.new do
|
61
|
+
def format(result)
|
62
|
+
raise "Unable to format"
|
63
|
+
end
|
64
|
+
end
|
65
|
+
]
|
66
|
+
|
67
|
+
SimpleCov.at_exit do
|
68
|
+
puts SimpleCov.result.format!.join
|
69
|
+
end
|
70
|
+
SimpleCov.start do
|
71
|
+
add_group 'Libs', 'lib/faked_project/'
|
72
|
+
end
|
73
|
+
"""
|
74
|
+
|
75
|
+
When I successfully run `bundle exec rake test`
|
76
|
+
Then the output should contain "lib/faked_project/meta_magic.rb (coverage: 100.0%)"
|
77
|
+
And the output should match /Formatter [^\s]* failed with RuntimeError: Unable to format/
|
@@ -14,7 +14,7 @@ Feature:
|
|
14
14
|
When I open the coverage report generated with `bundle exec rspec spec`
|
15
15
|
Then I should see the groups:
|
16
16
|
| name | coverage | files |
|
17
|
-
| All Files |
|
17
|
+
| All Files | 91.23% | 6 |
|
18
18
|
|
19
19
|
And I should see the source files:
|
20
20
|
| name | coverage |
|
@@ -24,7 +24,7 @@ Feature: Grouping on RSpec using a custom filter class
|
|
24
24
|
When I open the coverage report generated with `bundle exec rspec spec`
|
25
25
|
Then I should see the groups:
|
26
26
|
| name | coverage | files |
|
27
|
-
| All Files |
|
27
|
+
| All Files | 91.23% | 6 |
|
28
28
|
| By filter class | 78.26% | 2 |
|
29
29
|
| By string | 100.0% | 1 |
|
30
30
|
| Ungrouped | 100.0% | 3 |
|
@@ -13,18 +13,18 @@ World(GroupHelpers)
|
|
13
13
|
Then /^I should see the groups:$/ do |table|
|
14
14
|
expected_groups = table.hashes
|
15
15
|
# Given group names should be the same number than those rendered in report
|
16
|
-
expected_groups.count.
|
16
|
+
expect(expected_groups.count).to eq(available_groups.count)
|
17
17
|
|
18
18
|
# Verify each of the expected groups has a file list container and corresponding title and coverage number
|
19
19
|
# as well as the correct number of links to files.
|
20
20
|
expected_groups.each do |group|
|
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
|
-
file_count_in_group.
|
23
|
+
expect(file_count_in_group).to eq(group["files"].to_i)
|
24
24
|
|
25
25
|
with_scope "h2" do
|
26
|
-
page.
|
27
|
-
page.
|
26
|
+
expect(page).to have_content(group["name"])
|
27
|
+
expect(page).to have_content(group["coverage"])
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
@@ -32,14 +32,14 @@ end
|
|
32
32
|
|
33
33
|
Then /^I should see the source files:$/ do |table|
|
34
34
|
expected_files = table.hashes
|
35
|
-
expected_files.length.
|
35
|
+
expect(expected_files.length).to eq(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('h4 > span').text} }
|
39
39
|
|
40
|
-
files.sort_by {|hsh| hsh["name"] }.
|
40
|
+
expect(files.sort_by {|hsh| hsh["name"] }).to eq(expected_files.sort_by {|hsh| hsh["name"] })
|
41
41
|
end
|
42
42
|
|
43
43
|
Then /^there should be (\d+) skipped lines in the source files$/ do |expected_count|
|
44
|
-
all(".source_table ol li.skipped").count.
|
44
|
+
expect(all(".source_table ol li.skipped").count).to eq(expected_count.to_i)
|
45
45
|
end
|
@@ -31,27 +31,27 @@ end
|
|
31
31
|
|
32
32
|
Then /^(?:|I )should see "([^"]*)"(?: within "([^"]*)")?$/ do |text, selector|
|
33
33
|
with_scope(selector) do
|
34
|
-
page.
|
34
|
+
expect(page).to have_content(text)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
38
|
Then /^(?:|I )should see \/([^\/]*)\/(?: within "([^"]*)")?$/ do |regexp, selector|
|
39
39
|
regexp = Regexp.new(regexp)
|
40
40
|
with_scope(selector) do
|
41
|
-
page.
|
41
|
+
expect(page).to have_xpath('//*', :text => regexp)
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
45
|
Then /^(?:|I )should not see "([^"]*)"(?: within "([^"]*)")?$/ do |text, selector|
|
46
46
|
with_scope(selector) do
|
47
|
-
page.
|
47
|
+
expect(page).to have_no_content(text)
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
51
|
Then /^(?:|I )should not see \/([^\/]*)\/(?: within "([^"]*)")?$/ do |regexp, selector|
|
52
52
|
regexp = Regexp.new(regexp)
|
53
53
|
with_scope(selector) do
|
54
|
-
page.
|
54
|
+
expect(page).to have_no_xpath('//*', :text => regexp)
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
|
-
gem "aruba", "~> 0.
|
5
|
+
gem "aruba", "~> 0.6"
|
6
6
|
gem "capybara", "~> 2.0"
|
7
7
|
gem "poltergeist", "~> 1.1.0"
|
8
|
-
gem "phantomjs", "~> 1.
|
9
|
-
gem "cucumber", "
|
8
|
+
gem "phantomjs", "~> 1.9"
|
9
|
+
gem "cucumber", "~> 1.1"
|
10
10
|
gem "activesupport", "~> 3.2.0"
|
11
11
|
gem "multi_json", "~> 1.0.0"
|
12
12
|
|
13
|
-
gemspec :path=>"../"
|
13
|
+
gemspec :path => "../"
|
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
|
-
gem "aruba", "~> 0.
|
5
|
+
gem "aruba", "~> 0.6"
|
6
6
|
gem "capybara", "~> 2.0"
|
7
7
|
gem "poltergeist", "~> 1.1.0"
|
8
|
-
gem "phantomjs", "~> 1.
|
9
|
-
gem "cucumber", "
|
8
|
+
gem "phantomjs", "~> 1.9"
|
9
|
+
gem "cucumber", "~> 1.1"
|
10
10
|
gem "activesupport", "~> 3.2.0"
|
11
11
|
gem "multi_json", ">= 1.3.4"
|
12
12
|
|
13
|
-
gemspec :path=>"../"
|
13
|
+
gemspec :path => "../"
|
@@ -9,11 +9,11 @@ module SimpleCov::CommandGuesser
|
|
9
9
|
# between rails unit/functional/integration tests impossible without this cached
|
10
10
|
# item.
|
11
11
|
attr_accessor :original_run_command
|
12
|
-
|
12
|
+
|
13
13
|
def guess
|
14
14
|
from_env || from_command_line_options || from_defined_constants
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
private
|
18
18
|
|
19
19
|
def from_env
|
@@ -24,10 +24,10 @@ module SimpleCov::CommandGuesser
|
|
24
24
|
"(#{number}/#{ENV['PARALLEL_TEST_GROUPS']})"
|
25
25
|
end
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
28
|
def from_command_line_options
|
29
29
|
case original_run_command
|
30
|
-
when /test\/functional\//, /test
|
30
|
+
when /test\/functional\//, /test\/\{.*functional.*\}\//
|
31
31
|
"Functional Tests"
|
32
32
|
when /test\/integration\//
|
33
33
|
"Integration Tests"
|
@@ -41,7 +41,7 @@ module SimpleCov::CommandGuesser
|
|
41
41
|
nil
|
42
42
|
end
|
43
43
|
end
|
44
|
-
|
44
|
+
|
45
45
|
def from_defined_constants
|
46
46
|
# If the command regexps fail, let's try checking defined constants.
|
47
47
|
if defined?(RSpec)
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'fileutils'
|
2
2
|
require 'docile'
|
3
|
+
require 'simplecov/formatter/multi_formatter'
|
3
4
|
#
|
4
5
|
# Bundles the configuration options used for SimpleCov. All methods
|
5
6
|
# defined here are usable from SimpleCov directly. Please check out
|
@@ -74,6 +75,24 @@ module SimpleCov::Configuration
|
|
74
75
|
@formatter
|
75
76
|
end
|
76
77
|
|
78
|
+
#
|
79
|
+
# Sets the configured formatters.
|
80
|
+
#
|
81
|
+
def formatters=(formatters)
|
82
|
+
@formatter = SimpleCov::Formatter::MultiFormatter[*formatters]
|
83
|
+
end
|
84
|
+
|
85
|
+
#
|
86
|
+
# Gets the configured formatters.
|
87
|
+
#
|
88
|
+
def formatters
|
89
|
+
if @formatter.is_a?(SimpleCov::Formatter::MultiFormatter)
|
90
|
+
@formatter.formatters
|
91
|
+
else
|
92
|
+
Array(formatter)
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
77
96
|
#
|
78
97
|
# Certain code blocks (i.e. Ruby-implementation specific code) can be excluded from
|
79
98
|
# the coverage metrics by wrapping it inside # :nocov: comment blocks. The nocov token
|
data/lib/simplecov/defaults.rb
CHANGED
@@ -4,7 +4,7 @@ require 'simplecov-html'
|
|
4
4
|
SimpleCov.profiles.define 'root_filter' do
|
5
5
|
# Exclude all files outside of simplecov root
|
6
6
|
add_filter do |src|
|
7
|
-
!(src.filename =~ /^#{Regexp.escape(SimpleCov.root)}/)
|
7
|
+
!(src.filename =~ /^#{Regexp.escape(SimpleCov.root)}/i)
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
@@ -77,12 +77,18 @@ at_exit do
|
|
77
77
|
SimpleCov::LastRun.write(:result => {:covered_percent => covered_percent})
|
78
78
|
end
|
79
79
|
|
80
|
-
|
80
|
+
# Force exit with stored status (see github issue #5)
|
81
|
+
# unless it's nil or 0 (see github issue #281)
|
82
|
+
Kernel.exit @exit_status if @exit_status && @exit_status > 0
|
81
83
|
end
|
82
84
|
|
83
85
|
# Autoload config from ~/.simplecov if present
|
84
|
-
|
85
|
-
|
86
|
+
require 'etc'
|
87
|
+
home_dir = Dir.home || Etc.getpwuid.dir || (user = ENV["USER"] && Dir.home(user))
|
88
|
+
if home_dir
|
89
|
+
global_config_path = File.join(home_dir, '.simplecov')
|
90
|
+
load global_config_path if File.exist?(global_config_path)
|
91
|
+
end
|
86
92
|
|
87
93
|
# Autoload config from .simplecov if present
|
88
94
|
config_path = File.join(SimpleCov.root, '.simplecov')
|
data/lib/simplecov/file_list.rb
CHANGED
@@ -31,14 +31,16 @@ class SimpleCov::FileList < Array
|
|
31
31
|
end
|
32
32
|
|
33
33
|
# Computes the coverage based upon lines covered and lines missed
|
34
|
+
# @return [Float]
|
34
35
|
def covered_percent
|
35
36
|
return 100.0 if empty? or lines_of_code == 0
|
36
|
-
covered_lines * 100.0 / lines_of_code
|
37
|
+
Float(covered_lines * 100.0 / lines_of_code)
|
37
38
|
end
|
38
39
|
|
39
40
|
# Computes the strength (hits / line) based upon lines covered and lines missed
|
41
|
+
# @return [Float]
|
40
42
|
def covered_strength
|
41
|
-
return 0 if empty? or lines_of_code == 0
|
42
|
-
map {|f| f.covered_strength * f.lines_of_code }.inject(&:+) / lines_of_code
|
43
|
+
return 0.0 if empty? or lines_of_code == 0
|
44
|
+
Float(map {|f| f.covered_strength * f.lines_of_code }.inject(&:+) / lines_of_code)
|
43
45
|
end
|
44
46
|
end
|
@@ -1,25 +1,28 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
module SimpleCov
|
2
|
+
module Formatter
|
3
|
+
class MultiFormatter
|
4
|
+
def self.[](*args)
|
5
|
+
Class.new(self) do
|
6
|
+
define_method :formatters do
|
7
|
+
@formatters ||= args
|
8
|
+
end
|
9
|
+
end
|
6
10
|
end
|
7
|
-
end
|
8
|
-
end
|
9
11
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
def format(result)
|
13
|
+
formatters.map do |formatter|
|
14
|
+
begin
|
15
|
+
formatter.new.format(result)
|
16
|
+
rescue => e
|
17
|
+
STDERR.puts("Formatter #{formatter} failed with #{e.class}: #{e.message} (#{e.backtrace.first})")
|
18
|
+
nil
|
19
|
+
end
|
20
|
+
end
|
17
21
|
end
|
18
|
-
end
|
19
|
-
end
|
20
22
|
|
21
|
-
|
22
|
-
|
23
|
+
def formatters
|
24
|
+
@formatters ||= []
|
25
|
+
end
|
26
|
+
end
|
23
27
|
end
|
24
|
-
|
25
28
|
end
|
@@ -1,19 +1,23 @@
|
|
1
1
|
#
|
2
2
|
# A ridiculously simple formatter for SimpleCov results.
|
3
3
|
#
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
4
|
+
module SimpleCov
|
5
|
+
module Formatter
|
6
|
+
class SimpleFormatter
|
7
|
+
# Takes a SimpleCov::Result and generates a string out of it
|
8
|
+
def format(result)
|
9
|
+
output = ""
|
10
|
+
result.groups.each do |name, files|
|
11
|
+
output << "Group: #{name}\n"
|
12
|
+
output << "="*40
|
13
|
+
output << "\n"
|
14
|
+
files.each do |file|
|
15
|
+
output << "#{file.filename} (coverage: #{file.covered_percent.round(2)}%)\n"
|
16
|
+
end
|
17
|
+
output << "\n"
|
18
|
+
end
|
19
|
+
output
|
14
20
|
end
|
15
|
-
output << "\n"
|
16
21
|
end
|
17
|
-
output
|
18
22
|
end
|
19
23
|
end
|
@@ -10,6 +10,10 @@ module SimpleCov::ResultMerger
|
|
10
10
|
File.join(SimpleCov.coverage_path, '.resultset.json')
|
11
11
|
end
|
12
12
|
|
13
|
+
def resultset_writelock
|
14
|
+
File.join(SimpleCov.coverage_path, '.resultset.json.lock')
|
15
|
+
end
|
16
|
+
|
13
17
|
# Loads the cached resultset from YAML and returns it as a Hash
|
14
18
|
def resultset
|
15
19
|
if stored_data
|
@@ -66,12 +70,14 @@ module SimpleCov::ResultMerger
|
|
66
70
|
|
67
71
|
# Saves the given SimpleCov::Result in the resultset cache
|
68
72
|
def store_result(result)
|
69
|
-
|
70
|
-
command_name, data = result.to_hash.first
|
71
|
-
new_set[command_name] = data
|
72
|
-
File.open(resultset_path, "w+") do |f|
|
73
|
+
File.open(resultset_writelock, "w+") do |f|
|
73
74
|
f.flock(File::LOCK_EX)
|
74
|
-
|
75
|
+
new_set = resultset
|
76
|
+
command_name, data = result.to_hash.first
|
77
|
+
new_set[command_name] = data
|
78
|
+
File.open(resultset_path, "w+") do |f_|
|
79
|
+
f_.puts SimpleCov::JSON.dump(new_set)
|
80
|
+
end
|
75
81
|
end
|
76
82
|
true
|
77
83
|
end
|
@@ -111,24 +111,24 @@ module SimpleCov
|
|
111
111
|
return 100.0 if lines.length == 0 or lines.length == never_lines.count
|
112
112
|
relevant_lines = lines.count - never_lines.count - skipped_lines.count
|
113
113
|
if relevant_lines == 0
|
114
|
-
0
|
114
|
+
0.0
|
115
115
|
else
|
116
|
-
(covered_lines.count) * 100.0 / relevant_lines.to_f
|
116
|
+
Float((covered_lines.count) * 100.0 / relevant_lines.to_f)
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
120
120
|
def covered_strength
|
121
|
-
return 0 if lines.length == 0 or lines.length == never_lines.count
|
121
|
+
return 0.0 if lines.length == 0 or lines.length == never_lines.count
|
122
122
|
|
123
123
|
lines_strength = 0
|
124
124
|
lines.each do |c|
|
125
125
|
lines_strength += c.coverage if c.coverage
|
126
126
|
end
|
127
127
|
|
128
|
-
effective_lines_count = (lines.count - never_lines.count - skipped_lines.count)
|
128
|
+
effective_lines_count = Float(lines.count - never_lines.count - skipped_lines.count)
|
129
129
|
|
130
130
|
if effective_lines_count == 0
|
131
|
-
0
|
131
|
+
0.0
|
132
132
|
else
|
133
133
|
strength = lines_strength / effective_lines_count
|
134
134
|
round_float(strength, 1)
|
@@ -178,9 +178,10 @@ module SimpleCov
|
|
178
178
|
private
|
179
179
|
|
180
180
|
# ruby 1.9 could use Float#round(places) instead
|
181
|
+
# @return [Float]
|
181
182
|
def round_float(float, places)
|
182
|
-
factor = (10 * places)
|
183
|
-
(float * factor).round / factor
|
183
|
+
factor = Float(10 * places)
|
184
|
+
Float((float * factor).round / factor)
|
184
185
|
end
|
185
186
|
end
|
186
187
|
end
|
data/lib/simplecov/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module SimpleCov
|
2
|
-
VERSION = "0.
|
3
|
-
end
|
2
|
+
VERSION = "0.9.0"
|
3
|
+
end
|
data/simplecov.gemspec
CHANGED
@@ -17,10 +17,11 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.add_dependency 'simplecov-html', '~> 0.8.0'
|
18
18
|
gem.add_dependency 'docile', '~> 1.1.0'
|
19
19
|
|
20
|
-
gem.add_development_dependency 'appraisal', '~> 0
|
21
|
-
gem.add_development_dependency 'rake', '~> 10.
|
22
|
-
gem.add_development_dependency 'rspec', '~>
|
23
|
-
gem.add_development_dependency '
|
20
|
+
gem.add_development_dependency 'appraisal', '~> 1.0'
|
21
|
+
gem.add_development_dependency 'rake', '~> 10.3'
|
22
|
+
gem.add_development_dependency 'rspec', '~> 3.0'
|
23
|
+
gem.add_development_dependency 'rspec-legacy_formatters', '~> 1.0'
|
24
|
+
gem.add_development_dependency 'shoulda', '~> 3.5'
|
24
25
|
|
25
26
|
gem.files = `git ls-files`.split("\n")
|
26
27
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
@@ -1,23 +1,23 @@
|
|
1
1
|
Given /^I want to keep stuff simple$/ do
|
2
|
-
1.
|
2
|
+
expect(1).to eq(1)
|
3
3
|
end
|
4
4
|
|
5
5
|
When /^I write my cukes for the fake project$/ do
|
6
|
-
1.
|
6
|
+
expect(1).to eq(1)
|
7
7
|
end
|
8
8
|
|
9
9
|
Then /^I make all neccessary tests in a single step$/ do
|
10
|
-
FakedProject.foo.
|
10
|
+
expect(FakedProject.foo).to eq('bar')
|
11
11
|
|
12
|
-
FrameworkSpecific.cucumber.
|
12
|
+
expect(FrameworkSpecific.cucumber).to eq("Only tested in Cucumber")
|
13
13
|
|
14
|
-
FakedProject.a_class_method.
|
14
|
+
expect(FakedProject.a_class_method).to eq("this is a mixed-in class method")
|
15
15
|
|
16
|
-
FakedProject.new.an_instance_method.
|
17
|
-
FakedProject.new.dynamic.
|
16
|
+
expect(FakedProject.new.an_instance_method).to eq("this is a mixed-in instance method")
|
17
|
+
expect(FakedProject.new.dynamic).to eq("A dynamically defined instance method")
|
18
18
|
|
19
19
|
something = SomeClass.new("foo")
|
20
|
-
something.reverse.
|
21
|
-
something.compare_with('foo').
|
20
|
+
expect(something.reverse).to eq('oof')
|
21
|
+
expect(something.compare_with('foo')).to be true
|
22
22
|
end
|
23
23
|
|
@@ -2,10 +2,10 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe FakedProject do
|
4
4
|
it "should return proper foo" do
|
5
|
-
FakedProject.foo.
|
5
|
+
expect(FakedProject.foo).to eq('bar')
|
6
6
|
end
|
7
7
|
|
8
8
|
it "should test it's framework specific method" do
|
9
|
-
FrameworkSpecific.rspec.
|
9
|
+
expect(FrameworkSpecific.rspec).to eq("Only tested in RSpec")
|
10
10
|
end
|
11
11
|
end
|
@@ -2,9 +2,14 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe FakedProject do
|
4
4
|
it "should have added a class method to FakedProject" do
|
5
|
-
FakedProject.a_class_method.
|
5
|
+
expect(FakedProject.a_class_method).to eq("this is a mixed-in class method")
|
6
6
|
end
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
it "should have added a mixed-in instance method to FakedProject" do
|
9
|
+
expect(subject.an_instance_method).to eq("this is a mixed-in instance method")
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should have added a dyntamically-defined instance method to FakedProject" do
|
13
|
+
expect(subject.dynamic).to eq("A dynamically defined instance method")
|
14
|
+
end
|
10
15
|
end
|
@@ -3,8 +3,11 @@ require 'spec_helper'
|
|
3
3
|
describe SomeClass do
|
4
4
|
subject { SomeClass.new("foo") }
|
5
5
|
|
6
|
-
|
6
|
+
it "should be reversible" do
|
7
|
+
expect(subject.reverse).to eq('oof')
|
8
|
+
end
|
9
|
+
|
7
10
|
it "should compare with 'foo'" do
|
8
|
-
subject.compare_with('foo').
|
11
|
+
expect(subject.compare_with('foo')).to be true
|
9
12
|
end
|
10
13
|
end
|
metadata
CHANGED
@@ -1,113 +1,127 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplecov
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christoph Olszowka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: simplecov-html
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 0.8.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.8.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: docile
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 1.1.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 1.1.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: appraisal
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0
|
61
|
+
version: '1.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0
|
68
|
+
version: '1.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - ~>
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 10.
|
75
|
+
version: '10.3'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - ~>
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 10.
|
82
|
+
version: '10.3'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - ~>
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: '3.0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - ~>
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: '3.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rspec-legacy_formatters
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.0'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: shoulda
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
|
-
- - ~>
|
115
|
+
- - "~>"
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version: 3.
|
117
|
+
version: '3.5'
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
|
-
- - ~>
|
122
|
+
- - "~>"
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version: 3.
|
124
|
+
version: '3.5'
|
111
125
|
description: Code coverage for Ruby 1.9+ with a powerful configuration library and
|
112
126
|
automatic merging of coverage across test suites
|
113
127
|
email:
|
@@ -116,9 +130,10 @@ executables: []
|
|
116
130
|
extensions: []
|
117
131
|
extra_rdoc_files: []
|
118
132
|
files:
|
119
|
-
- .gitignore
|
120
|
-
- .
|
121
|
-
- .
|
133
|
+
- ".gitignore"
|
134
|
+
- ".rspec"
|
135
|
+
- ".travis.yml"
|
136
|
+
- ".yardopts"
|
122
137
|
- Appraisals
|
123
138
|
- CHANGELOG.md
|
124
139
|
- CONTRIBUTING.md
|
@@ -237,17 +252,17 @@ require_paths:
|
|
237
252
|
- lib
|
238
253
|
required_ruby_version: !ruby/object:Gem::Requirement
|
239
254
|
requirements:
|
240
|
-
- -
|
255
|
+
- - ">="
|
241
256
|
- !ruby/object:Gem::Version
|
242
257
|
version: '0'
|
243
258
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
244
259
|
requirements:
|
245
|
-
- -
|
260
|
+
- - ">="
|
246
261
|
- !ruby/object:Gem::Version
|
247
262
|
version: '0'
|
248
263
|
requirements: []
|
249
264
|
rubyforge_project:
|
250
|
-
rubygems_version: 2.
|
265
|
+
rubygems_version: 2.2.2
|
251
266
|
signing_key:
|
252
267
|
specification_version: 4
|
253
268
|
summary: Code coverage for Ruby 1.9+ with a powerful configuration library and automatic
|