Sha256: 13f390b7f14313ae4fb439cd86c2ec5e38708835dc596bd97eef85fcd29a59db

Contents?: true

Size: 1.45 KB

Versions: 8

Compression:

Stored size: 1.45 KB

Contents

require "spec_helper"

describe BBC::Cosmos::Config do

  subject { BBC::Cosmos::Config }
  let (:expected_config) do
    {
      :config_key => "config_value"
    }
  end

  describe ".app" do
    describe "application config attribute" do
      it "should be accessible using method notation" do
        expect(subject.app.config_key).to eq("config_value")
      end
    end
  end

  describe ".cosmos" do
    describe "#component_config" do
      it "returns the cosmos component_config" do
        expect(subject.cosmos.component_config).to eq(expected_config)
      end
    end

    describe "#stack_name" do
      it "returns the cosmos stack name" do
        expect(subject.cosmos.stack_name).to eq("stack_name")
      end
    end

    describe "#component_name" do
      it "returns the cosmos component name" do
        expect(subject.cosmos.component_name).to eq("component_name")
      end
    end
  end

  describe ".aws" do
    describe "#tags" do
      it "returns the aws tags" do
        expect(subject.aws.tags).to eq(
          {
            "aws:cloudformation:stack-name" => "stack_name",
            "Component" => "component_name"
          }
        )
      end
    end

    describe "#region" do
      it "returns the aws region" do
        expect(subject.aws.region).to eq("eu-west-1")
      end
    end

    describe "#region" do
      it "returns the aws instance_id" do
        expect(subject.aws.instance_id).to eq("instance_id")
      end
    end
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
bbc-cosmos-config-0.1.1 spec/config_spec.rb
bbc-cosmos-config-0.1.0 spec/config_spec.rb
bbc-cosmos-config-0.0.9 spec/config_spec.rb
bbc-cosmos-config-0.0.8 spec/config_spec.rb
bbc-cosmos-config-0.0.7 spec/config_spec.rb
bbc-cosmos-config-0.0.6 spec/config_spec.rb
bbc-cosmos-config-0.0.5 spec/config_spec.rb
bbc-cosmos-config-0.0.4 spec/config_spec.rb