dashingrocket / simplecov-cobertura

Ruby SimpleCov Cobertura Formatter
Apache License 2.0
52 stars 38 forks source link

Fix keyword argument warnings for specs for Ruby 2.7 #15

Closed splattael closed 3 years ago

splattael commented 3 years ago

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/

Screenshots

Console output before and after when running Ruby 2.7 with RUBYOPT="-W:depricated":

Before After
Screenshot from 2020-11-19 13-20-32 Screenshot from 2020-11-19 13-20-47
jessebs commented 3 years ago

Thank you very much for this fix!