Sha256: 9c0462eb0ed58f5f5ca9946a4f1bc9c1ef764f35acef70898a108b61cba69f18

Contents?: true

Size: 1.38 KB

Versions: 129

Compression:

Stored size: 1.38 KB

Contents

require 'spec_helper'
require 'specinfra/helper/detect_os/darwin'

describe Specinfra::Helper::DetectOs::Darwin do
  darwin = Specinfra::Helper::DetectOs::Darwin.new(Specinfra.backend)
  it 'Should return darwin 13.4.0 when Mac OS X 10.9.5 (Mavericks) is installed.' do
    allow(darwin).to receive(:run_command) {
      CommandResult.new(:stdout => 'Darwin 13.4.0', :exit_status => 0)
    }
    expect(darwin.detect).to include(
      :family  => 'darwin',
      :release => '13.4.0'
    )
  end
  it 'Should return darwin 12.6.0 when Mac OS X 10.8.5 (Mountain Lion) is installed.' do
    allow(darwin).to receive(:run_command) {
      CommandResult.new(:stdout => 'Darwin 12.6.0', :exit_status => 0)
    }
    expect(darwin.detect).to include(
      :family  => 'darwin',
      :release => '12.6.0'
    )
  end
  it 'Should return darwin 11.4.2 when Mac OS X 10.7.5 (Lion) is installed.' do
    allow(darwin).to receive(:run_command) {
      CommandResult.new(:stdout => 'Darwin 11.4.2', :exit_status => 0)
    }
    expect(darwin.detect).to include(
      :family  => 'darwin',
      :release => '11.4.2'
    )
  end
  it 'Should return darwin nil when Darwin FooBar is installed.' do
    allow(darwin).to receive(:run_command) {
      CommandResult.new(:stdout => 'Darwin FooBar', :exit_status => 0)
    }
    expect(darwin.detect).to include(
      :family  => 'darwin',
      :release => nil
    )
  end
end

Version data entries

129 entries across 129 versions & 1 rubygems

Version Path
specinfra-2.91.0 spec/helper/detect_os/darwin_spec.rb
specinfra-2.90.1 spec/helper/detect_os/darwin_spec.rb
specinfra-2.90.0 spec/helper/detect_os/darwin_spec.rb
specinfra-2.89.0 spec/helper/detect_os/darwin_spec.rb
specinfra-2.88.2 spec/helper/detect_os/darwin_spec.rb
specinfra-2.88.1 spec/helper/detect_os/darwin_spec.rb
specinfra-2.88.0 spec/helper/detect_os/darwin_spec.rb
specinfra-2.87.2 spec/helper/detect_os/darwin_spec.rb
specinfra-2.87.1 spec/helper/detect_os/darwin_spec.rb
specinfra-2.87.0 spec/helper/detect_os/darwin_spec.rb
specinfra-2.86.0 spec/helper/detect_os/darwin_spec.rb
specinfra-2.85.1 spec/helper/detect_os/darwin_spec.rb
specinfra-2.85.0 spec/helper/detect_os/darwin_spec.rb
specinfra-2.84.1 spec/helper/detect_os/darwin_spec.rb
specinfra-2.84.0 spec/helper/detect_os/darwin_spec.rb
specinfra-2.83.4 spec/helper/detect_os/darwin_spec.rb
specinfra-2.83.3 spec/helper/detect_os/darwin_spec.rb
specinfra-2.83.2 spec/helper/detect_os/darwin_spec.rb
specinfra-2.83.1 spec/helper/detect_os/darwin_spec.rb
specinfra-2.83.0 spec/helper/detect_os/darwin_spec.rb