Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

21 lines (18 sloc) 0.576 kb
require 'spec_helper'
require 'open3'
describe VCAP::ProcessUtils do
describe '.get_stats' do
it 'should parse fields correctly' do
VCAP::Subprocess.stub!(:run).and_return(['123 456 7.8', '', 0])
stats = VCAP::ProcessUtils.get_stats(12345)
stats[:rss].should == 123
stats[:vsize].should == 456
stats[:pcpu].should == 7.8
end
it "should return nil if the process isn't running" do
Open3.stub!(:capture3).and_return(['', '', 1])
stats = VCAP::ProcessUtils.get_stats(12345)
stats.should be_nil
end
end
end
Jump to Line
Something went wrong with that request. Please try again.