Skip to content

Commit

Permalink
Fix keyword argument warnings for specs for Ruby 2.7 (#15)
Browse files Browse the repository at this point in the history
When running specs via `RUBYOPT="-W:deprecated" rake` Ruby 2.7 emits
with following warnings:

<path>/test/simplecov-cobertura_test.rb:12:
warning: Passing the keyword argument as the last hash parameter is
deprecated
<path>/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/simplecov-0.19.1/lib/simplecov/result.rb:28:
warning: The called method `initialize' is defined here

This commit fixes the warning.

See also
https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/
  • Loading branch information
splattael authored Nov 19, 2020
1 parent 50af7c3 commit c9ae437
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions test/simplecov-cobertura_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
require 'simplecov-cobertura'

class CoberturaFormatterTest < Test::Unit::TestCase

def setup
@result = SimpleCov::Result.new("#{__FILE__}" => [1,2])
@result = SimpleCov::Result.new({ "#{__FILE__}" => [1,2] })
@formatter = SimpleCov::Formatter::CoberturaFormatter.new
end

Expand Down

0 comments on commit c9ae437

Please sign in to comment.