2014-06-15 13:24:15 -04:00
|
|
|
require File.expand_path('on_what', File.dirname(File.dirname(__FILE__)))
|
|
|
|
|
2014-06-11 18:54:08 -04:00
|
|
|
begin
|
|
|
|
require 'simplecov'
|
|
|
|
require 'coveralls'
|
2013-07-05 15:46:29 -04:00
|
|
|
|
2014-06-11 18:54:08 -04:00
|
|
|
# On Ruby 1.9+ use SimpleCov and publish to Coveralls.io
|
2014-06-15 13:24:15 -04:00
|
|
|
if !on_1_8?
|
2014-06-11 18:54:08 -04:00
|
|
|
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
|
|
|
SimpleCov::Formatter::HTMLFormatter,
|
|
|
|
Coveralls::SimpleCov::Formatter
|
|
|
|
]
|
|
|
|
SimpleCov.start do
|
|
|
|
add_filter '/spec/' # exclude test code
|
|
|
|
add_filter '/vendor/' # exclude gems which are vendored on Travis CI
|
|
|
|
end
|
2011-12-06 14:46:46 -05:00
|
|
|
|
2014-06-11 18:54:08 -04:00
|
|
|
# Remove Docile, which was required by SimpleCov, to require again later
|
|
|
|
Object.send(:remove_const, :Docile)
|
|
|
|
$LOADED_FEATURES.reject! { |f| f =~ /\/docile\// }
|
|
|
|
end
|
|
|
|
rescue LoadError
|
|
|
|
warn 'warning: simplecov/coveralls gems not found; skipping coverage'
|
2014-02-21 15:10:13 -05:00
|
|
|
end
|
2011-12-06 14:46:46 -05:00
|
|
|
|
2014-02-21 15:10:13 -05:00
|
|
|
lib_dir = File.join(File.dirname(File.dirname(__FILE__)), 'lib')
|
|
|
|
$LOAD_PATH.unshift lib_dir unless $LOAD_PATH.include? lib_dir
|
2011-12-06 14:46:46 -05:00
|
|
|
|
2014-02-21 15:10:13 -05:00
|
|
|
# Require Docile again, now with coverage enabled on 1.9+
|
2013-04-01 04:48:31 -04:00
|
|
|
require 'docile'
|
2014-02-04 13:54:06 -05:00
|
|
|
|
2014-02-21 15:10:13 -05:00
|
|
|
require 'singleton'
|
|
|
|
require 'rspec'
|
|
|
|
|
2014-02-04 13:54:06 -05:00
|
|
|
RSpec.configure do |config|
|
|
|
|
config.expect_with :rspec do |c|
|
|
|
|
c.syntax = :expect
|
|
|
|
end
|
2014-06-11 18:54:08 -04:00
|
|
|
end
|