spec/spec_helper.rb in hydra-access-controls-11.0.0.rc1 vs spec/spec_helper.rb in hydra-access-controls-11.0.0.rc2
- old
+ new
@@ -9,16 +9,26 @@
$LOAD_PATH.unshift(File.dirname(__FILE__))
Hydra::Engine.config.autoload_paths.each { |path| $LOAD_PATH.unshift path }
require 'byebug' unless ENV['CI']
-if ENV['COVERAGE'] and RUBY_VERSION =~ /^1.9/
+def coverage_needed?
+ ENV['COVERAGE'] || ENV['CI']
+end
+
+if RUBY_VERSION =~ /^1.9/ && coverage_needed?
require 'simplecov'
- require 'simplecov-rcov'
+ require 'coveralls'
- SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
- SimpleCov.start
+ SimpleCov.root(File.expand_path('../../../', __FILE__))
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
+ [
+ SimpleCov::Formatter::HTMLFormatter,
+ Coveralls::SimpleCov::Formatter
+ ]
+ )
+ SimpleCov.start('rails')
end
# Since we're not doing a Rails Engine test, we have to load these classes manually:
require 'active_support'
require 'active_support/dependencies'
@@ -50,6 +60,5 @@
RSpec.configure do |config|
config.before(:each) do
ActiveFedora::Cleaner.clean!
end
end
-