Sha256: ebcc1008d38e4cb05267959ce2a96316a25373978c561b12602b78b2f94c1b68

Contents?: true

Size: 789 Bytes

Versions: 6

Compression:

Stored size: 789 Bytes

Contents

require 'spec_helper'

describe Stackster do
  before do
    @config_stub = stub 'Config', :logger => @logger_stub, :access_key => 'key', :secret_key => 'XXX', :region => 'us-west1'
    @response_stub = stub 'Excon::Response', :body => { 
        'reservationSet' => [{'instanceSet' => [{'ipAddress' => '192.168.1.1'}]}]
    }

    @cf_mock = mock 'CloudFormation'
    Fog::Compute::AWS.stub(:new).and_return(@cf_mock)

    @ec2 = Stackster::AWS::EC2.new(:config => @config_stub)
  end

  describe "describe_instances" do
    it "should return  the Cloud Formation description of the instances" do
      @cf_mock.should_receive(:describe_instances).and_return(@response_stub)

      @ec2.describe_instances.should == [{'instanceSet' => [{'ipAddress' => '192.168.1.1'}]}]
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
stackster-0.4.2 spec/aws/ec2_spec.rb
stackster-0.4.1 spec/aws/ec2_spec.rb
stackster-0.4.0 spec/aws/ec2_spec.rb
stackster-0.3.2 spec/aws/ec2_spec.rb
stackster-0.3.1 spec/aws/ec2_spec.rb
stackster-0.3.0 spec/aws/ec2_spec.rb