Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Better Rubymine compatibility for .simplecov

Rubymine's code coverage tools separate collection from reporting so
that multiple runs can have their data merged.  To separate, collecting
from reporting, SimpleCov.start is only run when not using Rubymine (as
indicated by a lack of the RM_INFO environment variable).  This way,
`rake spec` will collect coverage info and generate the report as
before, but Rubymine will only collect coverage when using 'Run ... with
coverage enabled' button and will only generate a report when using
'Generate Coverage Report' as is the intended behavior in Rubymine.
  • Loading branch information...
commit 3c2c808457b1dc3a9ea3bc23d1ad463b10d76b5e 1 parent e2ed4f2
@limhoff-r7 limhoff-r7 authored
Showing with 8 additions and 6 deletions.
  1. +8 −0 .simplecov
  2. +0 −6 spec/spec_helper.rb
View
8 .simplecov
@@ -1,3 +1,11 @@
+# RM_INFO is set when using Rubymine. In Rubymine, starting SimpleCov is
+# controlled by running with coverage, so don't explicitly start coverage (and
+# therefore generate a report) when in Rubymine. This _will_ generate a report
+# whenever `rake spec` is run.
+unless ENV['RM_INFO']
+ SimpleCov.start
+end
+
SimpleCov.configure do
# ignore this file
add_filter '.simplecov'
View
6 spec/spec_helper.rb
@@ -11,12 +11,6 @@
# must be first require and started before any other requires so that it can measure coverage of all following required
# code. It is after the rubygems and bundler only because Bundler.setup supplies the LOAD_PATH to simplecov.
require 'simplecov'
-# Ensure the coverage directory is always the same no matter where the individual spec is in the hierarchy when using
-# Rubymine to run one spec.
-#
-# @see https://github.com/colszowka/simplecov/issues/95
-SimpleCov.root(root_pathname)
-SimpleCov.start
require 'rspec/core'
Please sign in to comment.
Something went wrong with that request. Please try again.