Sha256: 902049b6867665422d92b8e128f3b656a13bd91cab20219ec3410c5018fc7dc6

Contents?: true

Size: 581 Bytes

Versions: 2

Compression:

Stored size: 581 Bytes

Contents

require "dry/web/settings/file_loader"

RSpec.describe Dry::Web::Settings::FileLoader do
  let(:klass) { Dry::Web::Settings::FileLoader }
  let(:root) { SPEC_ROOT.join("fixtures/multiple_env_files") }
  let(:env) { :test }
  subject(:data) { klass.new.(root, env)  }

  describe "#call" do
    it "will create hash with both variables from files" do
      expect(subject["ONLY_ON_ENV"]).to eq ("will be loaded from env")
      expect(subject["ONLY_IN_TEST"]).to eq ("will be loaded from env.test")
      expect(subject["IN_BOTH_ENVIRONMENT"]).to eq (".env.test")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dry-web-0.7.1 spec/unit/settings/file_loader_spec.rb
dry-web-0.7.0 spec/unit/settings/file_loader_spec.rb