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.37.4 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.37.3 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.37.2 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.37.1 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.37.0 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.36.18 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.36.17 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.36.16 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.36.15 spec/helper/detect_os/openbsd_spec.rb
specinfra-2.36.14 spec/helper/detect_os/openbsd_spec.rb