Sha256: 1846ce25bbe2596d9b581f0bdab7ebf2438eb59dc5298dcb57f54d628d75d533

Contents?: true

Size: 867 Bytes

Versions: 10

Compression:

Stored size: 867 Bytes

Contents

require 'spec_helper'

describe Mulder do

  describe '.search' do
    it 'uses the human formatter for the given params' do
      mock_config = mock
      Mulder::Config.expects(:from).with(:yaml, file: 'config/aws.yml').returns(mock_config)

      mock_connection = stub
      Mulder::Connection.expects(:new).with(mock_config).returns(mock_connection)

      mock_client = stub
      Mulder::Client.expects(:new).with(mock_connection, 'foo-app', 'production', 'WebServerGroup').returns(mock_client)

      mock_instances = stub
      mock_client.expects(:instances).returns(['foo'])

      mocked_formatter = stub
      Mulder::Formatter.expects(:new).with(['foo'], 'human').returns(mocked_formatter)

      mocked_formatter.expects(:output).once
      described_class.search('foo-app', 'production', 'WebServerGroup', 'human', 'config/aws.yml')
    end
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
mulder-0.4.0 spec/lib/mulder_spec.rb
mulder-0.3.2 spec/lib/mulder_spec.rb
mulder-0.3.1 spec/lib/mulder_spec.rb
mulder-0.3.0 spec/lib/mulder_spec.rb
mulder-0.2.1 spec/lib/mulder_spec.rb
mulder-0.2.0 spec/lib/mulder_spec.rb
mulder-0.1.0 spec/lib/mulder_spec.rb
mulder-0.0.5 spec/lib/mulder_spec.rb
mulder-0.0.4 spec/lib/mulder_spec.rb
mulder-0.0.3 spec/lib/mulder_spec.rb