spec/spec_helper.rb in attr_masker-0.2.1 vs spec/spec_helper.rb in attr_masker-0.3.0
- old
+ new
@@ -1,11 +1,36 @@
# (c) 2017 Ribose Inc.
#
+# Warnings gem must be added to Gemfile or otherwise loaded in order to have
+# the following configuration in effect.
+#
+# TODO: Add Warning to gemspec or Gemfile after dropping support for Ruby 2.3.
+begin
+ require "warning"
+
+ # Deduplicate warnings
+ Warning.dedup
+
+ # Ignore all warnings in Gem dependencies
+ Gem.path.each do |path|
+ Warning.ignore(//, path)
+ end
+rescue LoadError
+end
+
+require "simplecov"
+SimpleCov.start
+
+if ENV.key?("CI")
+ require "codecov"
+ SimpleCov.formatter = SimpleCov::Formatter::Codecov
+end
+
require "bundler"
Bundler.require :default, :development
-Dir[File.expand_path "../support/**/*.rb", __FILE__].sort.each { |f| require f }
+Dir[File.expand_path "support/**/*.rb", __dir__].sort.each { |f| require f }
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"