Sha256: 699e3433aed013f3745cad63f6afcf4d33e4c59f99b21534cac6ddcf032bcf8f

Contents?: true

Size: 1.19 KB

Versions: 34

Compression:

Stored size: 1.19 KB

Contents

require 'spec_helper'

describe Cuboid::System::Platforms::Windows, if: Cuboid.windows? do
    it_should_behave_like 'Cuboid::System::Platforms::Base'

    subject { described_class.new }

    describe '#memory_free' do
        it 'returns the amount of free memory' do
            expect(subject.memory_free).to be > 0
        end
    end

    describe '#disk_space_free' do
        it 'returns the amount of free disk space' do
            expect(subject.disk_space_free).to be > 0
        end
    end

    describe '#memory_for_process_group' do
        it 'returns bytes of memory used by the group' do
            expect(subject.memory_for_process_group( Process.pid )).to be > 0
        end
    end

    describe '.current?' do
        context 'when running on Windows' do
            it 'returns true'do
                expect(Cuboid).to receive(:windows?).and_return( true )
                expect(described_class).to be_current
            end
        end

        context 'when not running on Windows' do
            it 'returns false' do
                expect(Cuboid).to receive(:windows?).and_return( false )
                expect(described_class).to_not be_current
            end
        end
    end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
cuboid-0.2.13 spec/cuboid/system/platforms/windows_spec.rb
cuboid-0.2.12 spec/cuboid/system/platforms/windows_spec.rb
cuboid-0.2.11 spec/cuboid/system/platforms/windows_spec.rb
cuboid-0.2.10 spec/cuboid/system/platforms/windows_spec.rb
cuboid-0.2.9 spec/cuboid/system/platforms/windows_spec.rb
cuboid-0.2.8 spec/cuboid/system/platforms/windows_spec.rb
cuboid-0.2.7 spec/cuboid/system/platforms/windows_spec.rb
cuboid-0.2.6 spec/cuboid/system/platforms/windows_spec.rb
cuboid-0.2.5 spec/cuboid/system/platforms/windows_spec.rb
cuboid-0.2.4.2 spec/cuboid/system/platforms/windows_spec.rb
cuboid-0.2.4.1 spec/cuboid/system/platforms/windows_spec.rb
cuboid-0.2.4 spec/cuboid/system/platforms/windows_spec.rb
cuboid-0.2.3 spec/cuboid/system/platforms/windows_spec.rb
cuboid-0.2.2 spec/cuboid/system/platforms/windows_spec.rb
cuboid-0.2.1 spec/cuboid/system/platforms/windows_spec.rb
cuboid-0.2 spec/cuboid/system/platforms/windows_spec.rb
cuboid-0.1.9.1 spec/cuboid/system/platforms/windows_spec.rb
cuboid-0.1.9 spec/cuboid/system/platforms/windows_spec.rb
cuboid-0.1.8 spec/cuboid/system/platforms/windows_spec.rb
cuboid-0.1.7 spec/cuboid/system/platforms/windows_spec.rb