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.60.3 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.60.2 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.60.1 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.60.0 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.59.6 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.59.5 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.59.4 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.59.3 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.59.2 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.59.1 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.59.0 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.58.0 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.57.5 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.57.4 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.57.3 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.57.2 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.57.1 spec/helper/detect_os/openbsd_spec.rb
specinfra-cisco-2.41.0 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.57.0 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.56.1 spec/helper/detect_os/openbsd_spec.rb