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.82.25 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.82.24 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.82.23 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.82.22 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.82.21 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.82.20 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.82.19 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.82.18 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.82.17 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.82.16 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.82.15 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.82.14 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.82.13 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.82.12 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.82.11 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.82.10 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.82.9 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.82.8 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.82.7 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.82.6 spec/helper/detect_os/freebsd_spec.rb