Sha256: 2acac2b0f345747181d3a2b67913fb0f9744392c5a7e329f49520bfeaf6fdd7b

Contents?: true

Size: 1.34 KB

Versions: 210

Compression:

Stored size: 1.34 KB

Contents

require 'spec_helper'
require 'specinfra/helper/detect_os/openbsd'

describe Specinfra::Helper::DetectOs::Openbsd do
  openbsd = Specinfra::Helper::DetectOs::Openbsd.new(:exec)
  it 'Should return (fictional) openbsd 10.11 when OpenBSD 10.11 is installed.' do
    allow(openbsd).to receive(:run_command) {
      CommandResult.new(:stdout => 'OpenBSD 10.11', :exit_status => 0)
    }
    expect(openbsd.detect).to include(
      :family  => 'openbsd',
      :release => '10.11'
    )
  end
  it 'Should return openbsd 5.7 when OpenBSD 5.7 is installed.' do
    allow(openbsd).to receive(:run_command) {
      CommandResult.new(:stdout => 'OpenBSD 5.7', :exit_status => 0)
    }
    expect(openbsd.detect).to include(
      :family  => 'openbsd',
      :release => '5.7'
    )
  end
  it 'Should return openbsd 5.6 when OpenBSD 5.6 is installed.' do
    allow(openbsd).to receive(:run_command) {
      CommandResult.new(:stdout => 'OpenBSD 5.6', :exit_status => 0)
    }
    expect(openbsd.detect).to include(
      :family  => 'openbsd',
      :release => '5.6'
    )
  end
  it 'Should return openbsd nil when OpenBSD FooBar is installed.' do
    allow(openbsd).to receive(:run_command) {
      CommandResult.new(:stdout => 'OpenBSD FooBar', :exit_status => 0)
    }
    expect(openbsd.detect).to include(
      :family  => 'openbsd',
      :release => nil
    )
  end
end

Version data entries

210 entries across 210 versions & 3 rubygems

Version Path
specinfra-2.82.25 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.82.24 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.82.23 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.82.22 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.82.21 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.82.20 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.82.19 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.82.18 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.82.17 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.82.16 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.82.15 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.82.14 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.82.13 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.82.12 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.82.11 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.82.10 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.82.9 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.82.8 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.82.7 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.82.6 spec/helper/detect_os/openbsd_spec.rb