Sha256: 6e38b591df34f74fa94caac61b0fcb6786f17ca8f2b7cb000ff06376fc066392

Contents?: true

Size: 935 Bytes

Versions: 7

Compression:

Stored size: 935 Bytes

Contents

require_relative "spec_helper_initializer"

describe "Shakapacker::Instance" do
  before :each do
    ENV.delete("WEBPACKER_CONFIG")
    ENV.delete("SHAKAPACKER_CONFIG")
    Shakapacker.instance = Shakapacker::Instance.new
  end

  after :each do
    ENV.delete("WEBPACKER_CONFIG")
    ENV.delete("SHAKAPACKER_CONFIG")
    Shakapacker.instance = Shakapacker::Instance.new
  end

  it "uses default config path if no env variable defined" do
    actual_config_path = Rails.root.join("config/shakapacker.yml")
    expected_config_path = Shakapacker.config.config_path

    expect(expected_config_path).to eq(actual_config_path)
  end

  it "uses SHAKAPACKER_CONFIG env variable for config file" do
    ENV["SHAKAPACKER_CONFIG"] = "/some/random/path.yml"

    actual_config_path = "/some/random/path.yml"
    expected_config_path = Shakapacker.config.config_path.to_s

    expect(expected_config_path).to eq(actual_config_path)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
shakapacker-7.0.3 spec/shakapacker/instance_spec.rb
shakapacker-7.0.2 spec/shakapacker/instance_spec.rb
shakapacker-7.0.1 spec/shakapacker/instance_spec.rb
shakapacker-7.0.0 spec/shakapacker/instance_spec.rb
shakapacker-7.0.0.rc.2 spec/shakapacker/instance_spec.rb
shakapacker-7.0.0.rc.1 spec/shakapacker/instance_spec.rb
shakapacker-7.0.0.rc.0 spec/instance_spec.rb