Sha256: 3245c1ed96a5a4df53d300a3e4a3873d30c19fb1a78a6c2a3b6941ece31be7ca

Contents?: true

Size: 668 Bytes

Versions: 5

Compression:

Stored size: 668 Bytes

Contents

require "spec_helper"

require "config_hound"

describe ConfigHound, "expansion" do

  given_resource "config.yml", %{
    var:
      port: 5678
    address: host:<(var.port)>
  }

  let(:config) { ConfigHound.load("config.yml", :expand_refs => true) }

  it "expands references" do
    expect(config["address"]).to eq("host:5678")
  end

  context "with overrides" do

    given_resource "overrides.yml", %{
      _include:
        - config.yml
      var:
        port: 9999
    }

    let(:config) { ConfigHound.load("overrides.yml", :expand_refs => true) }

    it "merges before expanding" do
      expect(config["address"]).to eq("host:9999")
    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
config_hound-1.4.3 spec/features/expansion_spec.rb
config_hound-1.4.2 spec/features/expansion_spec.rb
config_hound-1.4.1 spec/features/expansion_spec.rb
config_hound-1.4.0 spec/features/expansion_spec.rb
config_hound-1.3.2 spec/features/expansion_spec.rb