Sha256: 78aafb1be02984bb89c7450a003f3ea9fa9c79ae135586a4161658496b4fe274

Contents?: true

Size: 1.37 KB

Versions: 206

Compression:

Stored size: 1.37 KB

Contents

require 'spec_helper'
require 'specinfra/helper/detect_os/freebsd'

describe Specinfra::Helper::DetectOs::Freebsd do
  freebsd = Specinfra::Helper::DetectOs::Freebsd.new(:exec)
  it 'Should return freebsd 10 when FreeBSD 10.1-RELEASE is installed.' do
    allow(freebsd).to receive(:run_command) {
      CommandResult.new(:stdout => 'FreeBSD 10.1--RELEASE', :exit_status => 0)
    }
    expect(freebsd.detect).to include(
      :family  => 'freebsd',
      :release => '10'
    )
  end
  it 'Should return freebsd 9 when FreeBSD 9.3-RELEASE is installed.' do
    allow(freebsd).to receive(:run_command) {
      CommandResult.new(:stdout => 'FreeBSD 9.3-RELEASE', :exit_status => 0)
    }
    expect(freebsd.detect).to include(
      :family  => 'freebsd',
      :release => '9'
    )
  end
  it 'Should return freebsd 8 when FreeBSD 8.2-RELEASE-p3 is installed.' do
    allow(freebsd).to receive(:run_command) {
      CommandResult.new(:stdout => 'FreeBSD 8.2-RELEASE-p3', :exit_status => 0)
    }
    expect(freebsd.detect).to include(
      :family  => 'freebsd',
      :release => '8'
    )
  end
  it 'Should return freebsd nil when FreeBSD FooBar is installed.' do
    allow(freebsd).to receive(:run_command) {
      CommandResult.new(:stdout => 'FreeBSD FooBar', :exit_status => 0)
    }
    expect(freebsd.detect).to include(
      :family  => 'freebsd',
      :release => nil 
    )
  end
end

Version data entries

206 entries across 206 versions & 3 rubygems

Version Path
specinfra-2.76.5 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.76.4 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.76.3 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.76.2 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.76.1 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.76.0 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.75.1 spec/helper/detect_os/freebsd_spec.rb
specinfra-rb19-2.44.7 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.75.0 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.74.0 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.73.4 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.73.3 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.73.2 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.73.1 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.73.0 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.72.1 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.72.0 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.71.3 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.71.2 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.71.1 spec/helper/detect_os/freebsd_spec.rb