Sha256: 33e3023d001077d4a6a128a6f00d530706aa1d97719b3d038b2b561b35f53ae5

Contents?: true

Size: 994 Bytes

Versions: 32

Compression:

Stored size: 994 Bytes

Contents

shared_examples_for 'Cuboid::System::Platforms::Mixins::Unix' do
    it_should_behave_like 'Cuboid::System::Platforms::Base'

    subject { described_class.new }

    describe '#memory_for_process_group' do
        let(:ps) do
            <<EOTXT
   RSS
109744
 63732
 62236
 63876
 62772
 62856
 64504
EOTXT
        end

        it 'returns bytes of memory used by the group' do
            expect(subject).to receive(:pagesize).and_return(4096)
            expect(subject).to receive(:_exec).with('ps -o rss -g 123').and_return(ps)
            expect(subject.memory_for_process_group( 123 )).to eq 2005893120
        end
    end

    describe '#disk_space_free' do
        it 'returns the amount of free disk space' do
            o = Object.new
            expect(o).to receive(:available_bytes).and_return(1000)
            expect(Vmstat).to receive(:disk).with(Cuboid::Options.paths.os_tmpdir).and_return(o)

            expect(subject.disk_space_free).to eq 1000
        end
    end

end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
cuboid-0.2.11 spec/support/shared/system/platforms/mixins/unix.rb
cuboid-0.2.10 spec/support/shared/system/platforms/mixins/unix.rb
cuboid-0.2.9 spec/support/shared/system/platforms/mixins/unix.rb
cuboid-0.2.8 spec/support/shared/system/platforms/mixins/unix.rb
cuboid-0.2.7 spec/support/shared/system/platforms/mixins/unix.rb
cuboid-0.2.6 spec/support/shared/system/platforms/mixins/unix.rb
cuboid-0.2.5 spec/support/shared/system/platforms/mixins/unix.rb
cuboid-0.2.4.2 spec/support/shared/system/platforms/mixins/unix.rb
cuboid-0.2.4.1 spec/support/shared/system/platforms/mixins/unix.rb
cuboid-0.2.4 spec/support/shared/system/platforms/mixins/unix.rb
cuboid-0.2.3 spec/support/shared/system/platforms/mixins/unix.rb
cuboid-0.2.2 spec/support/shared/system/platforms/mixins/unix.rb
cuboid-0.2.1 spec/support/shared/system/platforms/mixins/unix.rb
cuboid-0.2 spec/support/shared/system/platforms/mixins/unix.rb
cuboid-0.1.9.1 spec/support/shared/system/platforms/mixins/unix.rb
cuboid-0.1.9 spec/support/shared/system/platforms/mixins/unix.rb
cuboid-0.1.8 spec/support/shared/system/platforms/mixins/unix.rb
cuboid-0.1.7 spec/support/shared/system/platforms/mixins/unix.rb
cuboid-0.1.6.1 spec/support/shared/system/platforms/mixins/unix.rb
cuboid-0.1.6 spec/support/shared/system/platforms/mixins/unix.rb