Sha256: 64e8f3651e2a87b89ad72b7f6240e692361a90386605783ef689ab80d3d8b8f6

Contents?: true

Size: 1.21 KB

Versions: 32

Compression:

Stored size: 1.21 KB

Contents

require 'spec_helper'
require 'bosh/stemcell/operating_system'

module Bosh::Stemcell
  describe OperatingSystem do
    describe '.for' do
      it 'returns the correct infrastrcture' do
        expect(OperatingSystem.for('centos')).to be_a(OperatingSystem::Centos)
        expect(OperatingSystem.for('ubuntu')).to be_a(OperatingSystem::Ubuntu)
      end

      it 'raises for unknown operating system' do
        expect {
          OperatingSystem.for('BAD_OPERATING_SYSTEM')
        }.to raise_error(ArgumentError, /invalid operating system: BAD_OPERATING_SYSTEM/)
      end
    end
  end

  describe OperatingSystem::Base do
    describe '#initialize' do
      it 'requires :name to be specified' do
        expect {
          OperatingSystem::Base.new
        }.to raise_error /key not found: :name/
      end
    end

    describe '#name' do
      subject { OperatingSystem::Base.new(name: 'CLOUDY_PONY_OS') }

      its(:name) { should eq('CLOUDY_PONY_OS') }
    end
  end

  describe OperatingSystem::Centos do
    subject { OperatingSystem::Centos.new }

    its(:name) { should eq('centos') }
  end

  describe OperatingSystem::Ubuntu do
    subject { OperatingSystem::Ubuntu.new }

    its(:name) { should eq('ubuntu') }
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

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