Sha256: 2bfd2b8e3bbccfdc41d431b91ba592000bdbe446ebb452eafa9ffacd738d9506
Contents?: true
Size: 1.2 KB
Versions: 14
Compression:
Stored size: 1.2 KB
Contents
# frozen_string_literal: true require 'spec_helper' require 'kpm/system_helpers/system_proxy' require 'kpm/system_helpers/os_information' describe KPM::SystemProxy::OsInformation do subject { described_class.new } let(:os_data) { subject.send(:build_hash, data) } context 'when running on Linux' do let(:data) { "Description:Ubuntu 16.04.1 LTS \n\n" } it { expect(subject.labels).to eq([{ label: :os_detail }, { label: :value }]) } it { expect(os_data).to eq({ 'Description' => { :os_detail => 'Description', :value => 'Ubuntu 16.04.1 LTS' } }) } end context 'when running on MacOS' do let(:data) { "ProductName:\tMac OS X\nProductVersion:\t10.14.6\nBuildVersion:\t18G87\n" } it { expect(subject.labels).to eq([{ label: :os_detail }, { label: :value }]) } it { expect(os_data).to eq({ 'ProductName' => { :os_detail => 'ProductName', :value => 'Mac OS X' }, 'ProductVersion' => { :os_detail => 'ProductVersion', :value => '10.14.6' }, 'BuildVersion' => { :os_detail => 'BuildVersion', :value => '18G87' } }) } end end
Version data entries
14 entries across 14 versions & 1 rubygems