spec/spec_helper.rb in preserve-1.0.0 vs spec/spec_helper.rb in preserve-2.0.0
- old
+ new
@@ -1,14 +1,20 @@
ENV['RAILS_ENV'] ||= 'test'
-require File.expand_path('../dummy/config/environment.rb', __FILE__)
+require 'bundler/setup'
+require 'coveralls'
+require 'rails'
-require 'rspec/rails'
+Coveralls.wear!
-Rails.backtrace_cleaner.remove_silencers!
+version = Rails::VERSION::MAJOR
+dummy_root = File.expand_path("dummy/rails-#{version}", __dir__)
-Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
+require "#{dummy_root}/config/environment.rb"
+require 'rspec/rails'
+Dir["#{__dir__}/support/**/*.rb"].each { |f| require f }
+
RSpec.configure do |config|
- config.color = true
config.include RequestHelpers, type: :request
+ config.include LegacyHelpers, type: :request if version < 5
end