Sha256: 140cbe1a99dd1c44ddbb5ff31bc286f27b671c56d71f6bda602fc29df596daed

Contents?: true

Size: 681 Bytes

Versions: 65

Compression:

Stored size: 681 Bytes

Contents

require File.dirname(__FILE__) + '/helper'

class TestSystemProcess < Test::Unit::TestCase
  def setup
    pid = Process.pid
    @process = System::Process.new(pid)
  end
  
  def test_exists_should_return_true_for_running_process
    assert_equal true, @process.exists?
  end
  
  def test_exists_should_return_false_for_non_existant_process
    assert_equal false, System::Process.new(9999999).exists?
  end
  
  def test_memory
    assert_kind_of Integer, @process.memory
    assert @process.memory > 0
  end
  
  def test_percent_memory
    assert_kind_of Float, @process.percent_memory
  end
  
  def test_percent_cpu
    assert_kind_of Float, @process.percent_cpu
  end
end

Version data entries

65 entries across 65 versions & 22 rubygems

Version Path
dguettler-god-0.7.13.2 test/test_system_process.rb
dguettler-god-0.7.13.3 test/test_system_process.rb
dosire-god-0.7.10 test/test_system_process.rb
dosire-god-0.7.12 test/test_system_process.rb
dosire-god-0.7.9 test/test_system_process.rb
dunedain289-god-0.7.12.1 test/test_system_process.rb
dustin-god-0.7.7.1 test/test_system_process.rb
eric-god-0.7.10 test/test_system_process.rb
eric-god-0.7.11 test/test_system_process.rb
eric-god-0.7.12 test/test_system_process.rb
eric-god-0.7.14 test/test_system_process.rb
eric-god-0.7.7 test/test_system_process.rb
fotonauts-god-0.7.10 test/test_system_process.rb
fotonauts-god-0.7.12 test/test_system_process.rb
gohanlonllc-god-0.7.9 test/test_system_process.rb
gordoncww-god-0.7.11.1 test/test_system_process.rb
jreynolds-god-0.7.13 test/test_system_process.rb
jwilkins-god-0.7.9 test/test_system_process.rb
mathieuravaux-god-0.7.11 test/test_system_process.rb
mojombo-god-0.7.10 test/test_system_process.rb