Sha256: 0223c0a7dd3ac4d053b60cde97820ac459572eca4c405711e3417e41ccac3fe0

Contents?: true

Size: 611 Bytes

Versions: 12

Compression:

Stored size: 611 Bytes

Contents

require_relative "./test_app/config/environment"

Rails.env = "production"

Shakapacker.instance = ::Shakapacker::Instance.new

def reloaded_config
  Shakapacker.instance.instance_variable_set(:@env, nil)
  Shakapacker.instance.instance_variable_set(:@config, nil)
  Shakapacker.instance.instance_variable_set(:@dev_server, nil)
  Shakapacker.env
  Shakapacker.config
  Shakapacker.dev_server
end

def with_rails_env(env)
  original = Rails.env
  Rails.env = ActiveSupport::StringInquirer.new(env)
  reloaded_config
  yield
ensure
  Rails.env = ActiveSupport::StringInquirer.new(original)
  reloaded_config
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
shakapacker-7.2.3 spec/shakapacker/spec_helper_initializer.rb
shakapacker-7.3.0.beta.1 spec/shakapacker/spec_helper_initializer.rb
shakapacker-7.2.2 spec/shakapacker/spec_helper_initializer.rb
shakapacker-7.2.1 spec/shakapacker/spec_helper_initializer.rb
shakapacker-7.2.0 spec/shakapacker/spec_helper_initializer.rb
shakapacker-7.1.0 spec/shakapacker/spec_helper_initializer.rb
shakapacker-7.0.3 spec/shakapacker/spec_helper_initializer.rb
shakapacker-7.0.2 spec/shakapacker/spec_helper_initializer.rb
shakapacker-7.0.1 spec/shakapacker/spec_helper_initializer.rb
shakapacker-7.0.0 spec/shakapacker/spec_helper_initializer.rb
shakapacker-7.0.0.rc.2 spec/shakapacker/spec_helper_initializer.rb
shakapacker-7.0.0.rc.1 spec/shakapacker/spec_helper_initializer.rb