Sha256: 1bd7b646016aa7d06a9401ae28e0f7dc2bdd1730471f03d0ffbf7943cc496cad

Contents?: true

Size: 1.23 KB

Versions: 8

Compression:

Stored size: 1.23 KB

Contents

require 'spec_helper'

describe Stackster do
  before do
    @logger_stub = stub 'logger stub', :info => 'true', :warn => 'true'
    @config_stub = stub 'Config', :logger => @logger_stub, :access_key => 'key', :secret_key => 'XXX', :region => 'us-west1'

    @stack_reader_mock = mock 'StackReader'
    Stackster::StackReader.stub(:new).and_return(@stack_reader_mock)
    @stack_reader_mock.stub(:attributes).and_return(:chef_repo_bucket_prefix => 'chef_repo_bp')
    @stack_reader_mock.stub(:outputs).and_return([{'key' => 'value'}])
    @stack_reader_mock.stub(:status).and_return('green')
    @stack_reader_mock.stub(:events).and_return(['event1', 'event2', 'event3'])
    @stack_reader_mock.stub(:resources).and_return([{'StackName' => 'my_stack'}])

    @stack_formater = Stackster::StackFormater.new(:name => 'my_stack', :config => @config_stub)
  end

  describe 'display' do
    it 'should return formatted information for the stack' do
      @stack_formater.display.should == {
        'attributes' => { :chef_repo_bucket_prefix => 'chef_repo_bp' },
        'status' => 'green',
        'outputs' => [{'key' => 'value'}],
        'events' => ['event1', 'event2', 'event3'],
        'resources' => [{'StackName' => 'my_stack'}]
      }
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
stackster-0.4.4 spec/stack/stack_formater_spec.rb
stackster-0.4.3 spec/stack/stack_formater_spec.rb
stackster-0.4.2 spec/stack/stack_formater_spec.rb
stackster-0.4.1 spec/stack/stack_formater_spec.rb
stackster-0.4.0 spec/stack/stack_formater_spec.rb
stackster-0.3.2 spec/stack/stack_formater_spec.rb
stackster-0.3.1 spec/stack/stack_formater_spec.rb
stackster-0.3.0 spec/stack/stack_formater_spec.rb