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.91.0 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.90.1 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.90.0 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.89.0 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.88.2 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.88.1 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.88.0 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.87.2 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.87.1 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.87.0 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.86.0 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.85.1 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.85.0 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.84.1 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.84.0 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.83.4 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.83.3 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.83.2 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.83.1 spec/helper/detect_os/freebsd_spec.rb
specinfra-2.83.0 spec/helper/detect_os/freebsd_spec.rb