simplecov 0.11.2 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c477692497bba3df0d4545ed9d4e4e7fd18b6918
4
- data.tar.gz: 9224079fa17a1993d471be4da3769f1c96139202
3
+ metadata.gz: c4ded95468b70d7817ca95004ac38a0b6ad2e388
4
+ data.tar.gz: 2bb87e0871a8daa3955049fa6e808968d479ea48
5
5
  SHA512:
6
- metadata.gz: 1143ac48afac3679abfa6a1187c29ad3d832c94951096670ba78062b9df2d95ef893a8996287f3ec4b2da3a77bd1753697e6a6d9d00e0d04f333d2e531ddbf78
7
- data.tar.gz: 62d25d8868801db9a8360743ef8bd0348b6ffb1f2fc99e674abbd703d7d1a9f0793ed6d6a7665206f149e9d2713fe58698d90d6a6b3839234453b3563c014411
6
+ metadata.gz: af959d1c396d33ac1f1f76e6108993d1e0af61e1f9059feb4dcbb598e46eceb51b930370d6e1f5f3711dc498ced9176a72ae125498f1d3b385581bba00c61466
7
+ data.tar.gz: fd27be25b4cca08be020931d330cc2a958559a49c61c8058b6433a55d75252b263502c74445efa21ee7a7683aceee6a4650501fe00a07ee25dbad546aef891f5
@@ -71,3 +71,7 @@ Style/TrailingCommaInLiteral:
71
71
 
72
72
  Style/GuardClause:
73
73
  Enabled: false
74
+
75
+ Style/MutableConstant:
76
+ Exclude:
77
+ - 'lib/simplecov/version.rb' # required for older versions of rubygems
@@ -13,15 +13,16 @@ rvm:
13
13
  - 1.8.7
14
14
  - 1.9.3
15
15
  - 2.0.0
16
- - 2.1
17
- - 2.2
16
+ - 2.1.10
17
+ - 2.2.5
18
+ - 2.3.0
18
19
  - ruby-head
19
- - jruby
20
+ - jruby-head
20
21
  - rbx-2
21
22
 
22
23
  matrix:
23
24
  allow_failures:
24
25
  - rvm: ruby-head
25
- - rvm: jruby
26
+ - rvm: jruby-head
26
27
  - rvm: rbx-2
27
28
  fast_finish: true
@@ -1,10 +1,22 @@
1
- Unreleased ([changes](https://github.com/colszowka/simplecov/compare/v0.11.2...master))
1
+ Unreleased ([changes](https://github.com/colszowka/simplecov/compare/v0.12.0...master))
2
+ ==========
3
+
4
+ ## Enhancements
5
+
6
+ ## Bugfixes
7
+
8
+ 0.12.0 2016-07-02 ([changes](https://github.com/colszowka/simplecov/compare/v0.11.2...v0.12.0))
2
9
  =================
3
10
 
4
11
  ## Enhancements
5
12
 
13
+ * Add support for JSON versions 2.x
14
+
6
15
  ## Bugfixes
7
16
 
17
+ * Fix coverage rate of the parallel_tests. See [#441](https://github.com/colszowka/simplecov/pull/441) (thanks @sinsoku)
18
+ * Fix a regression on old rubies that failed to work with the recently introduced frozen VERSION string. See [#461](https://github.com/colszowka/simplecov/pull/461) (thanks @leafle)
19
+
8
20
  0.11.2 2016-02-03 ([changes](https://github.com/colszowka/simplecov/compare/v0.11.1...v0.11.2))
9
21
  =================
10
22
 
data/Gemfile CHANGED
@@ -6,7 +6,7 @@ source "https://rubygems.org"
6
6
  # Uncomment this to use development version of html formatter from github
7
7
  # gem 'simplecov-html', :github => 'colszowka/simplecov-html'
8
8
 
9
- gem "rake", ">= 10.3"
9
+ gem "rake", Gem::Version.new(RUBY_VERSION) < Gem::Version.new("1.9.3") ? "~>10.3" : ">= 10.3"
10
10
 
11
11
  group :test do
12
12
  gem "rspec", ">= 3.2"
@@ -15,19 +15,21 @@ group :test do
15
15
  gem "activesupport", "~> 3.2.21"
16
16
  gem "i18n", "~> 0.6.11"
17
17
  end
18
+ platform :ruby_18, :ruby_19 do
19
+ gem "mime-types", "~> 1.25"
20
+ gem "json", "~> 1.8"
21
+ end
22
+ platform :ruby_18, :ruby_19, :ruby_20, :ruby_21 do
23
+ gem "rack", "~> 1.6"
24
+ end
18
25
  platform :jruby, :ruby_19, :ruby_20, :ruby_21, :ruby_22, :ruby_23 do
19
26
  gem "aruba", "~> 0.7.4"
20
- gem "capybara", "~> 2.4"
21
-
22
- # Hack until Capybara fixes its gemspec. 3.0 removed 1.9 support.
23
- # See https://github.com/jnicklas/capybara/issues/1615
24
- gem "mime-types", "~> 2.0.0"
25
-
26
- gem "cucumber", "~> 2.0"
27
+ gem "capybara"
28
+ gem "cucumber"
27
29
  gem "phantomjs", "~> 1.9"
28
- gem "poltergeist", "~> 1.1"
29
- gem "rubocop", "~> 0.36.0"
30
- gem "test-unit", "~> 3.0"
30
+ gem "poltergeist"
31
+ gem "rubocop", "~> 0.41.0"
32
+ gem "test-unit"
31
33
  end
32
34
  end
33
35
 
data/README.md CHANGED
@@ -1,4 +1,4 @@
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)
1
+ SimpleCov [![Build Status](https://travis-ci.org/colszowka/simplecov.svg)][Continuous Integration] [![Dependency Status](https://gemnasium.com/colszowka/simplecov.svg)][Dependencies] [![Code Climate](https://codeclimate.com/github/colszowka/simplecov.svg)](https://codeclimate.com/github/colszowka/simplecov) [![Inline docs](http://inch-ci.org/github/colszowka/simplecov.svg)](http://inch-ci.org/github/colszowka/simplecov)
2
2
  =========
3
3
  **Code coverage for Ruby**
4
4
 
@@ -146,19 +146,6 @@ to use SimpleCov with them. Here's an overview of the known ones:
146
146
  <a href="https://github.com/colszowka/simplecov/pull/185">#185</a>
147
147
  </td>
148
148
  </tr>
149
- <tr>
150
- <th>
151
- Riot
152
- </th>
153
- <td>
154
- A user has reported problems with the coverage report using the riot
155
- framework. If you experience similar trouble please follow up on the
156
- related GitHub issue.
157
- </td>
158
- <td>
159
- <a href="https://github.com/colszowka/simplecov/issues/80">#80</a>
160
- </td>
161
- </tr>
162
149
  <tr>
163
150
  <th>
164
151
  RubyMine
@@ -11,7 +11,7 @@ Given /^SimpleCov for (.*) is configured with:$/ do |framework, config_body|
11
11
  when /Cucumber/i
12
12
  "features/support"
13
13
  else
14
- fail ArgumentError, "Could not identify test framework #{framework}!"
14
+ raise ArgumentError, "Could not identify test framework #{framework}!"
15
15
  end
16
16
  end
17
17
 
@@ -45,6 +45,6 @@ end
45
45
  # Workaround for https://github.com/cucumber/aruba/pull/125
46
46
  Aruba.configure do |config|
47
47
  config.before_cmd do
48
- set_env("JRUBY_OPTS", "-X-C --1.9")
48
+ set_env("JRUBY_OPTS", "--dev --debug")
49
49
  end
50
50
  end
@@ -10,9 +10,10 @@ if defined?(JRUBY_VERSION) && defined?(JRuby)
10
10
  # @see https://github.com/colszowka/simplecov/issues/86
11
11
  # @see https://jira.codehaus.org/browse/JRUBY-6106
12
12
 
13
- unless JRuby.runtime.debug?
14
- warn 'Coverage may be inaccurate; set "cli.debug=true" ("-Xcli.debug=true") in your .jrubyrc or' \
15
- ' do JRUBY_OPTS="-d"'
13
+ unless org.jruby.RubyInstanceConfig.FULL_TRACE_ENABLED
14
+ warn 'Coverage may be inaccurate; set the "--debug" command line option,' \
15
+ ' or do JRUBY_OPTS="--debug"' \
16
+ ' or set the "debug.fullTrace=true" option in your .jrubyrc'
16
17
  end
17
18
  end
18
19
  module SimpleCov
@@ -124,7 +125,7 @@ module SimpleCov
124
125
  grouped[name] = SimpleCov::FileList.new(files.select { |source_file| filter.matches?(source_file) })
125
126
  grouped_files += grouped[name]
126
127
  end
127
- if groups.length > 0 && (other_files = files.reject { |source_file| grouped_files.include?(source_file) }).length > 0
128
+ if !groups.empty? && !(other_files = files.reject { |source_file| grouped_files.include?(source_file) }).empty?
128
129
  grouped["Ungrouped"] = SimpleCov::FileList.new(other_files)
129
130
  end
130
131
  grouped
@@ -85,7 +85,7 @@ module SimpleCov
85
85
  def formatter(formatter = nil)
86
86
  return @formatter if defined?(@formatter) && formatter.nil?
87
87
  @formatter = formatter
88
- fail "No formatter configured. Please specify a formatter using SimpleCov.formatter = SimpleCov::Formatter::SimpleFormatter" unless @formatter
88
+ raise "No formatter configured. Please specify a formatter using SimpleCov.formatter = SimpleCov::Formatter::SimpleFormatter" unless @formatter
89
89
  @formatter
90
90
  end
91
91
 
@@ -289,7 +289,7 @@ module SimpleCov
289
289
  elsif filter_argument.is_a?(Array)
290
290
  SimpleCov::ArrayFilter.new(filter_argument)
291
291
  else
292
- fail ArgumentError, "Please specify either a string or a block to filter with"
292
+ raise ArgumentError, "Please specify either a string or a block to filter with"
293
293
  end
294
294
  end
295
295
  end
@@ -17,7 +17,7 @@ module SimpleCov
17
17
  end
18
18
 
19
19
  def matches?(_)
20
- fail "The base filter class is not intended for direct use"
20
+ raise "The base filter class is not intended for direct use"
21
21
  end
22
22
 
23
23
  def passes?(source_file)
@@ -4,13 +4,12 @@ module SimpleCov
4
4
  def merge_resultset(array)
5
5
  new_array = dup
6
6
  array.each_with_index do |element, i|
7
- if element.nil? && new_array[i].nil?
8
- new_array[i] = nil
9
- else
10
- local_value = element || 0
11
- other_value = new_array[i] || 0
12
- new_array[i] = local_value + other_value
13
- end
7
+ pair = [element, new_array[i]]
8
+ new_array[i] = if pair.any?(&:nil?) && pair.map(&:to_i).all?(&:zero?)
9
+ nil
10
+ else
11
+ element.to_i + new_array[i].to_i
12
+ end
14
13
  end
15
14
  new_array
16
15
  end
@@ -15,7 +15,7 @@ module SimpleCov
15
15
  #
16
16
  def define(name, &blk)
17
17
  name = name.to_sym
18
- fail "SimpleCov Profile '#{name}' is already defined" unless self[name].nil?
18
+ raise "SimpleCov Profile '#{name}' is already defined" unless self[name].nil?
19
19
  self[name] = blk
20
20
  end
21
21
 
@@ -24,7 +24,7 @@ module SimpleCov
24
24
  #
25
25
  def load(name)
26
26
  name = name.to_sym
27
- fail "Could not find SimpleCov Profile called '#{name}'" unless key?(name)
27
+ raise "Could not find SimpleCov Profile called '#{name}'" unless key?(name)
28
28
  SimpleCov.configure(&self[name])
29
29
  end
30
30
  end
@@ -25,9 +25,9 @@ module SimpleCov
25
25
  alias number line_number
26
26
 
27
27
  def initialize(src, line_number, coverage)
28
- fail ArgumentError, "Only String accepted for source" unless src.is_a?(String)
29
- fail ArgumentError, "Only Fixnum accepted for line_number" unless line_number.is_a?(Fixnum)
30
- fail ArgumentError, "Only Fixnum and nil accepted for coverage" unless coverage.is_a?(Fixnum) || coverage.nil?
28
+ raise ArgumentError, "Only String accepted for source" unless src.is_a?(String)
29
+ raise ArgumentError, "Only Fixnum accepted for line_number" unless line_number.is_a?(Fixnum)
30
+ raise ArgumentError, "Only Fixnum and nil accepted for coverage" unless coverage.is_a?(Fixnum) || coverage.nil?
31
31
  @src = src
32
32
  @line_number = line_number
33
33
  @coverage = coverage
@@ -1,5 +1,5 @@
1
1
  module SimpleCov
2
- version = "0.11.2"
2
+ version = "0.12.0"
3
3
 
4
4
  def version.to_a
5
5
  split(".").map(&:to_i)
@@ -21,5 +21,5 @@ module SimpleCov
21
21
  to_a[3]
22
22
  end
23
23
 
24
- VERSION = version.freeze
24
+ VERSION = version
25
25
  end
@@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
14
14
 
15
15
  gem.required_ruby_version = ">= 1.8.7"
16
16
 
17
- gem.add_dependency "json", "~> 1.8"
17
+ gem.add_dependency "json", ">= 1.8", "< 3"
18
18
  gem.add_dependency "simplecov-html", "~> 0.10.0"
19
19
  gem.add_dependency "docile", "~> 1.1.0"
20
20
 
@@ -12,11 +12,11 @@ describe "Ruby 1.8 fallback" do
12
12
  end
13
13
 
14
14
  it "return false when calling SimpleCov.start with a block" do
15
- expect(SimpleCov.start { fail "Shouldn't reach this!" }).to be false
15
+ expect(SimpleCov.start { raise "Shouldn't reach this!" }).to be false
16
16
  end
17
17
 
18
18
  it "return false when calling SimpleCov.configure with a block" do
19
- expect(SimpleCov.configure { fail "Shouldn't reach this!" }).to be false
19
+ expect(SimpleCov.configure { raise "Shouldn't reach this!" }).to be false
20
20
  end
21
21
 
22
22
  it "allow to define a profile" do
@@ -14,7 +14,7 @@ class SomeClass
14
14
  if item == label
15
15
  return true
16
16
  else
17
- fail "Item does not match label"
17
+ raise "Item does not match label"
18
18
  end
19
19
  rescue
20
20
  false
@@ -2,6 +2,7 @@ require "spec_helper"
2
2
 
3
3
  describe "forking" do
4
4
  it do
5
- Process.waitpid(Kernel.fork {})
5
+ # TODO: The defined?(RUBY_ENGINE) check can be dropped for simplecov 1.0.0
6
+ Process.waitpid(Kernel.fork {}) unless defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
6
7
  end
7
8
  end
@@ -12,4 +12,4 @@ code = %{
12
12
  File.open(file, "w") { |f| f.print code }
13
13
  load file
14
14
  File.unlink file
15
- fail unless kill_the_buddha(3) == 27
15
+ raise unless kill_the_buddha(3) == 27
@@ -9,6 +9,7 @@ describe "merge helpers" do
9
9
  source_fixture("app/models/user.rb") => [nil, 1, 1, 1, nil, nil, 1, 0, nil, nil],
10
10
  source_fixture("app/controllers/sample_controller.rb") => [nil, 1, 1, 1, nil, nil, 1, 0, nil, nil],
11
11
  source_fixture("resultset1.rb") => [1, 1, 1, 1],
12
+ source_fixture("parallel_tests.rb") => [nil, 0, nil, 0],
12
13
  }.extend(SimpleCov::HashMergeHelper)
13
14
 
14
15
  @resultset2 = {
@@ -16,6 +17,7 @@ describe "merge helpers" do
16
17
  source_fixture("app/models/user.rb") => [nil, 1, 5, 1, nil, nil, 1, 0, nil, nil],
17
18
  source_fixture("app/controllers/sample_controller.rb") => [nil, 3, 1, nil, nil, nil, 1, 0, nil, nil],
18
19
  source_fixture("resultset2.rb") => [nil, 1, 1, nil],
20
+ source_fixture("parallel_tests.rb") => [nil, nil, 0, 0],
19
21
  }
20
22
  end
21
23
 
@@ -43,6 +45,10 @@ describe "merge helpers" do
43
45
  it "has proper results for resultset2.rb" do
44
46
  expect(subject[source_fixture("resultset2.rb")]).to eq([nil, 1, 1, nil])
45
47
  end
48
+
49
+ it "has proper results for parallel_tests.rb" do
50
+ expect(subject[source_fixture("parallel_tests.rb")]).to eq([nil, nil, nil, 0])
51
+ end
46
52
  end
47
53
 
48
54
  # See Github issue #6
@@ -4,14 +4,11 @@ require "helper"
4
4
  # See https://github.com/colszowka/simplecov/issues/5
5
5
  describe "return codes" do
6
6
  context "inside fixtures/frameworks" do
7
- before do
8
- @current_dir = Dir.getwd
9
- Dir.chdir(File.join(File.dirname(__FILE__), "fixtures", "frameworks"))
10
- FileUtils.rm_rf("./coverage")
11
- end
12
-
13
- after do
14
- Dir.chdir(@current_dir)
7
+ around do |test|
8
+ Dir.chdir(File.join(File.dirname(__FILE__), "fixtures", "frameworks")) do
9
+ FileUtils.rm_rf("./coverage")
10
+ test.call
11
+ end
15
12
  end
16
13
 
17
14
  it "has return code 0 when running testunit_good.rb" do
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplecov
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.2
4
+ version: 0.12.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: 2016-02-03 00:00:00.000000000 Z
11
+ date: 2016-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.8'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '3'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '1.8'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '3'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: simplecov-html
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -214,4 +220,82 @@ signing_key:
214
220
  specification_version: 4
215
221
  summary: Code coverage for Ruby 1.9+ with a powerful configuration library and automatic
216
222
  merging of coverage across test suites
217
- test_files: []
223
+ test_files:
224
+ - features/config_autoload.feature
225
+ - features/config_command_name.feature
226
+ - features/config_coverage_dir.feature
227
+ - features/config_deactivate_merging.feature
228
+ - features/config_formatters.feature
229
+ - features/config_merge_timeout.feature
230
+ - features/config_nocov_token.feature
231
+ - features/config_profiles.feature
232
+ - features/config_project_name.feature
233
+ - features/config_styles.feature
234
+ - features/config_tracked_files.feature
235
+ - features/cucumber_basic.feature
236
+ - features/maximum_coverage_drop.feature
237
+ - features/merging_test_unit_and_rspec.feature
238
+ - features/minimum_coverage.feature
239
+ - features/refuse_coverage_drop.feature
240
+ - features/rspec_basic.feature
241
+ - features/rspec_fails_on_initialization.feature
242
+ - features/rspec_groups_and_filters_basic.feature
243
+ - features/rspec_groups_and_filters_complex.feature
244
+ - features/rspec_groups_using_filter_class.feature
245
+ - features/rspec_without_simplecov.feature
246
+ - features/skipping_code_blocks_manually.feature
247
+ - features/step_definitions/html_steps.rb
248
+ - features/step_definitions/simplecov_steps.rb
249
+ - features/step_definitions/transformers.rb
250
+ - features/step_definitions/web_steps.rb
251
+ - features/support/env.rb
252
+ - features/test_unit_basic.feature
253
+ - features/test_unit_groups_and_filters_basic.feature
254
+ - features/test_unit_groups_and_filters_complex.feature
255
+ - features/test_unit_groups_using_filter_class.feature
256
+ - features/test_unit_without_simplecov.feature
257
+ - features/unicode_compatiblity.feature
258
+ - spec/1_8_fallbacks_spec.rb
259
+ - spec/command_guesser_spec.rb
260
+ - spec/deleted_source_spec.rb
261
+ - spec/faked_project/Gemfile
262
+ - spec/faked_project/Rakefile
263
+ - spec/faked_project/cucumber.yml
264
+ - spec/faked_project/features/step_definitions/my_steps.rb
265
+ - spec/faked_project/features/support/env.rb
266
+ - spec/faked_project/features/test_stuff.feature
267
+ - spec/faked_project/lib/faked_project.rb
268
+ - spec/faked_project/lib/faked_project/framework_specific.rb
269
+ - spec/faked_project/lib/faked_project/meta_magic.rb
270
+ - spec/faked_project/lib/faked_project/some_class.rb
271
+ - spec/faked_project/lib/faked_project/untested_class.rb
272
+ - spec/faked_project/spec/faked_spec.rb
273
+ - spec/faked_project/spec/forking_spec.rb
274
+ - spec/faked_project/spec/meta_magic_spec.rb
275
+ - spec/faked_project/spec/some_class_spec.rb
276
+ - spec/faked_project/spec/spec_helper.rb
277
+ - spec/faked_project/test/faked_test.rb
278
+ - spec/faked_project/test/meta_magic_test.rb
279
+ - spec/faked_project/test/some_class_test.rb
280
+ - spec/faked_project/test/test_helper.rb
281
+ - spec/file_list_spec.rb
282
+ - spec/filters_spec.rb
283
+ - spec/fixtures/app/controllers/sample_controller.rb
284
+ - spec/fixtures/app/models/user.rb
285
+ - spec/fixtures/deleted_source_sample.rb
286
+ - spec/fixtures/frameworks/rspec_bad.rb
287
+ - spec/fixtures/frameworks/rspec_good.rb
288
+ - spec/fixtures/frameworks/testunit_bad.rb
289
+ - spec/fixtures/frameworks/testunit_good.rb
290
+ - spec/fixtures/iso-8859.rb
291
+ - spec/fixtures/resultset1.rb
292
+ - spec/fixtures/resultset2.rb
293
+ - spec/fixtures/sample.rb
294
+ - spec/fixtures/utf-8.rb
295
+ - spec/helper.rb
296
+ - spec/merge_helpers_spec.rb
297
+ - spec/multi_formatter_spec.rb
298
+ - spec/result_spec.rb
299
+ - spec/return_codes_spec.rb
300
+ - spec/source_file_line_spec.rb
301
+ - spec/source_file_spec.rb