Sha256: fbf1a6cfde0b1c5f126c5b246c7fc09e311631adbab0e544050be710c50306ef

Contents?: true

Size: 799 Bytes

Versions: 32

Compression:

Stored size: 799 Bytes

Contents

require 'spec_helper'
require 'bosh/stemcell/aws/ami'

module Bosh::Stemcell::Aws
  describe Ami do
    let(:stemcell) do
      stemcell = double('Bosh::Dev::Stemcell')
      stemcell_manifest = { 'cloud_properties' => { 'ami' => '' } }
      stemcell.stub(:extract).and_yield('/foo/bar', stemcell_manifest)
      stemcell
    end

    subject(:ami) do
      Ami.new(stemcell, instance_double('Bosh::Stemcell::Aws::Region', name: 'fake-region'))
    end

    before do
      Logger.stub(:new)
    end

    describe 'publish' do
      it 'creates a new ami' do
        provider = instance_double('Bosh::AwsCloud::Cloud', create_stemcell: 'fake-ami-id').as_null_object
        Bosh::Clouds::Provider.stub(create: provider)

        expect(ami.publish).to eq('fake-ami-id')
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
bosh-stemcell-1.5.0.pre.1152 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1148 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1145 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1142 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1141 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1139 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1138 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1134 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1117 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1116 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1114 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1113 spec/bosh/stemcell/aws/ami_spec.rb