From e4539cff9e2dbae9c7c6493a56718ec47e34060a Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sun, 5 May 2019 09:35:25 +0200 Subject: [PATCH] Do not gather coverage on JRuby There are two reasons for this: - Coverage is inaccurate unless running in debug mode - Simplecov breaks on JRuby 1.7 in 1.8 mode --- Gemfile | 2 +- features/support/env.rb | 2 +- features/support/simplecov_setup.rb | 15 +++++++++------ spec/aruba/api_spec.rb | 1 + spec/spec_helper.rb | 8 +++++--- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/Gemfile b/Gemfile index 8ada8b1c5..7e774c1e4 100644 --- a/Gemfile +++ b/Gemfile @@ -70,7 +70,7 @@ group :development, :test do end # Code Coverage - gem 'simplecov', '~> 0.10' + gem 'simplecov', '~> 0.10' unless RUBY_PLATFORM.include?('java') # Test api gem 'rspec', '~> 3.4' diff --git a/features/support/env.rb b/features/support/env.rb index a7f804372..673dabd6e 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -1,7 +1,7 @@ $LOAD_PATH.unshift File.expand_path('../../../lib', __FILE__) # Has to be the first file required so that all other files show coverage information -require 'simplecov' +require 'simplecov' unless RUBY_PLATFORM.include?('java') # Standard Library require 'fileutils' diff --git a/features/support/simplecov_setup.rb b/features/support/simplecov_setup.rb index ce13c7ef9..093a7ca7d 100644 --- a/features/support/simplecov_setup.rb +++ b/features/support/simplecov_setup.rb @@ -1,8 +1,11 @@ -# @note this file is loaded in env.rb to setup simplecov using RUBYOPTs for child processes and @in-process -require 'simplecov' +# @note this file is loaded in env.rb to setup simplecov using RUBYOPTs for +# child processes and @in-process +unless RUBY_PLATFORM.include?('java') + require 'simplecov' -root = File.expand_path('../../../', __FILE__) + root = File.expand_path('../../../', __FILE__) -SimpleCov.command_name(ENV['SIMPLECOV_COMMAND_NAME']) -SimpleCov.root(root) -load File.join(root, '.simplecov') + SimpleCov.command_name(ENV['SIMPLECOV_COMMAND_NAME']) + SimpleCov.root(root) + load File.join(root, '.simplecov') +end diff --git a/spec/aruba/api_spec.rb b/spec/aruba/api_spec.rb index ab6285c35..15488fc7f 100644 --- a/spec/aruba/api_spec.rb +++ b/spec/aruba/api_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' require 'aruba/api' require 'fileutils' +require 'time' describe Aruba::Api do include_context 'uses aruba API' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e5dba34cb..9ecb0606a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,9 +2,11 @@ $LOAD_PATH << ::File.expand_path('../../lib', __FILE__) -require 'simplecov' -SimpleCov.command_name 'rspec' -SimpleCov.start +unless RUBY_PLATFORM.include?('java') + require 'simplecov' + SimpleCov.command_name 'rspec' + SimpleCov.start +end # Pull in all of the gems including those in the `test` group require 'bundler'