Sha256: b7bcfc8f0a9afe5fc19a5b313cfec12c97b2e15310b1e4f24a4b5e528bde9df9

Contents?: true

Size: 1.49 KB

Versions: 2

Compression:

Stored size: 1.49 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",
            "AppName" => "app_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

2 entries across 2 versions & 1 rubygems

Version Path
bbc-cosmos-config-0.2.0 spec/config_spec.rb
bbc-cosmos-config-0.1.2 spec/config_spec.rb