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.1226 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1215 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1211 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1210 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1209 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1193 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1190 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1181 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1179 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1178 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1177 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1176 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1173 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1172 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1168 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1166 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1165 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1164 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1154 spec/bosh/stemcell/aws/ami_spec.rb
bosh-stemcell-1.5.0.pre.1153 spec/bosh/stemcell/aws/ami_spec.rb