spec/spec_helper.rb in bugsnag-5.5.0 vs spec/spec_helper.rb in bugsnag-6.0.0
- old
+ new
@@ -1,5 +1,15 @@
+if ARGV.include? "--coverage"
+ require 'simplecov'
+ require 'coveralls'
+
+ SimpleCov.formatter = Coveralls::SimpleCov::Formatter
+ SimpleCov.start do
+ add_filter 'spec'
+ end
+end
+
require 'bugsnag'
require 'webmock/rspec'
require 'rspec/expectations'
@@ -16,9 +26,17 @@
event["exceptions"].last
end
def notify_test_exception(*args)
Bugsnag.notify(RuntimeError.new("test message"), *args)
+end
+
+def ruby_version_greater_equal?(version)
+ current_version = RUBY_VERSION.split "."
+ target_version = version.split "."
+ (Integer(current_version[0]) >= Integer(target_version[0])) &&
+ (Integer(current_version[1]) >= Integer(target_version[1])) &&
+ (Integer(current_version[2]) >= Integer(target_version[2]))
end
RSpec.configure do |config|
config.order = "random"