Allow disabling Knapsack when running RSpec tests

This commit is contained in:
Kristina Lim
2018-11-21 15:41:32 +08:00
parent abcb71f8b3
commit a460e9d35f

View File

@@ -6,9 +6,13 @@ require 'rubygems'
# Require pry when we're not inside Travis-CI
require 'pry' unless ENV['CI']
require 'knapsack'
Knapsack.tracker.config({enable_time_offset_warning: false}) unless ENV['CI']
Knapsack::Adapters::RSpecAdapter.bind
# This spec_helper.rb is being used by the custom engines in engines/. The engines are not set up to
# use Knapsack, and this provides the option to disable it when running the tests in CI services.
unless ENV['DISABLE_KNAPSACK']
require 'knapsack'
Knapsack.tracker.config({enable_time_offset_warning: false}) unless ENV['CI']
Knapsack::Adapters::RSpecAdapter.bind
end
ENV["RAILS_ENV"] ||= 'test'
require_relative "../config/environment"