Sha256: 3cd651bab1765b156c7d9ea84c9668dcd00022d22afd089d716dcc6fc7d2180d

Contents?: true

Size: 909 Bytes

Versions: 14

Compression:

Stored size: 909 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'
require 'kpm/system_helpers/system_proxy'
require 'kpm/system_helpers/entropy_available'

describe KPM::SystemProxy::EntropyAvailable do
  subject { described_class.new }
  let(:entropy_info) { subject.send(:build_hash, data) }

  context 'when running on Linux' do
    let(:data) { '182' }

    it {
      expect(subject.labels).to eq([{ label: :entropy },
                                    { label: :value }])
    }

    it {
      expect(entropy_info).to eq({ 'entropy_available' => { entropy: 'available', value: '182' } })
    }
  end

  context 'when running on MacOS' do
    let(:data) { '-' }

    it {
      expect(subject.labels).to eq([{ label: :entropy },
                                    { label: :value }])
    }

    it {
      expect(entropy_info).to eq({ 'entropy_available' => { entropy: 'available', value: '-' } })
    }
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
kpm-0.11.2 spec/kpm/unit/entropy_information_spec.rb
kpm-0.10.6 spec/kpm/unit/entropy_information_spec.rb
kpm-0.11.1 spec/kpm/unit/entropy_information_spec.rb
kpm-0.10.5 spec/kpm/unit/entropy_information_spec.rb
kpm-0.11.0 spec/kpm/unit/entropy_information_spec.rb
kpm-0.10.4 spec/kpm/unit/entropy_information_spec.rb
kpm-0.10.3 spec/kpm/unit/entropy_information_spec.rb
kpm-0.10.2 spec/kpm/unit/entropy_information_spec.rb
kpm-0.10.1 spec/kpm/unit/entropy_information_spec.rb
kpm-0.10.0 spec/kpm/unit/entropy_information_spec.rb
kpm-0.9.0 spec/kpm/unit/entropy_information_spec.rb
kpm-0.8.2 spec/kpm/unit/entropy_information_spec.rb
kpm-0.8.1 spec/kpm/unit/entropy_information_spec.rb
kpm-0.8.0 spec/kpm/unit/entropy_information_spec.rb