Sha256: 6baf627d7cf0285f102f8ca17b45929e95305f42c453ee1be402201eed9d1f72

Contents?: true

Size: 671 Bytes

Versions: 7

Compression:

Stored size: 671 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

7 entries across 7 versions & 1 rubygems

Version Path
god-0.13.4 test/test_system_process.rb
god-0.13.3 test/test_system_process.rb
god-0.13.2 test/test_system_process.rb
god-0.13.1 test/test_system_process.rb
god-0.13.0 test/test_system_process.rb
god-0.12.1 test/test_system_process.rb
god-0.12.0 test/test_system_process.rb