読者です 読者をやめる 読者になる 読者になる

JRuby 9.1.9.0とsimplecovの組み合わせによるエラーの対処

simplecov を JRuby 9.1.9.0 で実行した際に以下のようなエラーが出た場合は、JRuby 9.1.9.0 のリグレッションが原因。

Finished in 5.72 seconds (files took 3.22 seconds to load)
199 examples, 0 failures
NoMethodError: undefined method `status' for #<Array:0x64206cad>
        block in result at (erb):15
                   each at org/jruby/RubyArray.java:1734
        each_with_index at org/jruby/RubyEnumerable.java:1067
                 <eval> at (erb):14
                   eval at org/jruby/RubyKernel.java:1000
                 result at /home/travis/.rvm/rubies/jruby-9.1.9.0/lib/ruby/stdlib/erb.rb:864
  formatted_source_file at /home/travis/.rvm/gems/jruby-9.1.9.0/gems/simplecov-html-0.10.0/lib/simplecov-html.rb:56
        block in result at (erb):36
                   each at org/jruby/RubyArray.java:1734
                 <eval> at (erb):35
                   eval at org/jruby/RubyKernel.java:1000
                 result at /home/travis/.rvm/rubies/jruby-9.1.9.0/lib/ruby/stdlib/erb.rb:864
        block in format at /home/travis/.rvm/gems/jruby-9.1.9.0/gems/simplecov-html-0.10.0/lib/simplecov-html.rb:23
                   open at org/jruby/RubyIO.java:1156
                 format at /home/travis/.rvm/gems/jruby-9.1.9.0/gems/simplecov-html-0.10.0/lib/simplecov-html.rb:22
                format! at /home/travis/.rvm/gems/jruby-9.1.9.0/gems/simplecov-0.13.0/lib/simplecov/result.rb:47
       block in at_exit at /home/travis/.rvm/gems/jruby-9.1.9.0/gems/simplecov-0.13.0/lib/simplecov/configuration.rb:172
        block in (root) at /home/travis/.rvm/gems/jruby-9.1.9.0/gems/simplecov-0.13.0/lib/simplecov/defaults.rb:67

simplecov が依存している simplecov-html のバージョンをバグフィックス版の 0.10.1 にアップグレードすることで解決する。