Sha256: b0d1b55100aef8f8834a944d03be1f575aeb1d9bfcd49d82100ca8f4686f0770

Contents?: true

Size: 1.5 KB

Versions: 7

Compression:

Stored size: 1.5 KB

Contents

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

describe Specinfra::Helper::DetectOs::Darwin do
  darwin = Specinfra::Helper::DetectOs::Darwin.new(:exec)
  it 'Should return darwin 13.4.0 when Mac OS X 10.9.5 (Mavericks) is installed.' do
    allow(darwin).to receive(:run_command).with('uname -s') {
      CommandResult.new(:stdout => 'Darwin', :exit_status => 0)
    }
    allow(darwin).to receive(:run_command).with('uname -r') {
      CommandResult.new(:stdout => '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).with('uname -s') {
      CommandResult.new(:stdout => 'Darwin', :exit_status => 0)
    }
    allow(darwin).to receive(:run_command).with('uname -r') {
      CommandResult.new(:stdout => '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).with('uname -s') {
      CommandResult.new(:stdout => 'Darwin', :exit_status => 0)
    }
    allow(darwin).to receive(:run_command).with('uname -r') {
      CommandResult.new(:stdout => '11.4.2', :exit_status => 0)
    }
    expect(darwin.detect).to include(
      :family  => 'darwin',
      :release => '11.4.2'
    )
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
specinfra-2.36.17 spec/helper/detect_os/darwin_spec.rb
specinfra-2.36.16 spec/helper/detect_os/darwin_spec.rb
specinfra-2.36.15 spec/helper/detect_os/darwin_spec.rb
specinfra-2.36.14 spec/helper/detect_os/darwin_spec.rb
specinfra-2.36.13 spec/helper/detect_os/darwin_spec.rb
specinfra-2.36.12 spec/helper/detect_os/darwin_spec.rb
specinfra-2.36.11 spec/helper/detect_os/darwin_spec.rb