Sha256: 94087ab388be455b739806b3b18be2cd60611176e796486af8c875b868de918a

Contents?: true

Size: 1.17 KB

Versions: 3

Compression:

Stored size: 1.17 KB

Contents

require "spec_helper"
require "opsicle/config"
module Opsicle
  describe Config do
    subject { Config.new('derp') }
     before do
       YAML.stub(:load_file).with(File.expand_path '~/.fog').and_return({'derp' => { 'aws_access_key_id' => 'key', 'aws_secret_access_key' => 'secret'}})
       YAML.stub(:load_file).with('./.opsicle').and_return({'derp' => { 'app_id' => 'app', 'stack_id' => 'stack'}})
     end

    context "#aws_config" do
      it "should contain access_key_id" do
        subject.aws_config.should have_key(:access_key_id)
      end

      it "should contain secret_access_key" do
        subject.aws_config.should have_key(:secret_access_key)
      end
    end

    context "#opsworks_config" do
      it "should contain stack_id" do
        subject.opsworks_config.should have_key(:stack_id)
      end

      it "should contain app_id" do
        subject.opsworks_config.should have_key(:app_id)
      end
    end

    context "#configure_aws!" do
      it "should load the config into the AWS module" do
        AWS.should_receive(:config).with(hash_including(access_key_id: 'key', secret_access_key: 'secret'))
        subject.configure_aws!
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
opsicle-0.0.3 spec/opsicle/config_spec.rb
opsicle-0.0.2 spec/opsicle/config_spec.rb
opsicle-0.0.1 spec/opsicle/config_spec.rb