Sha256: 7705342cecd690ab858f9d5839edc2d920e0d055995d56b3185c0148c8286bba

Contents?: true

Size: 578 Bytes

Versions: 9

Compression:

Stored size: 578 Bytes

Contents

require 'spec_helper'
require 'natives/host_detection/platform'

describe Natives::HostDetection::Platform do
  let(:platform) { Natives::HostDetection::Platform.new }

  it "detects platform name" do
    platform.should_receive(:ohai_hash).and_return({platform: 'ubuntu'})
    expect(platform.name).to eq('ubuntu')
  end

  it "detects platform version" do
    platform.should_receive(:ohai_hash).
      and_return({platform_version: '12'})
    expect(platform.version).to eq('12')
  end

  it "uses Ohai" do
    expect(platform.ohai_hash).to be_kind_of Ohai::System
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
natives-0.6.2 spec/natives/host_detection/platform_spec.rb
natives-0.6.1 spec/natives/host_detection/platform_spec.rb
natives-0.6.0 spec/natives/host_detection/platform_spec.rb
natives-0.5.5 spec/natives/host_detection/platform_spec.rb
natives-0.5.4 spec/natives/host_detection/platform_spec.rb
natives-0.5.3 spec/natives/host_detection/platform_spec.rb
natives-0.5.2 spec/natives/host_detection/platform_spec.rb
natives-0.5.1 spec/natives/host_detection/platform_spec.rb
natives-0.5.0 spec/natives/host_detection/platform_spec.rb