Permalink
Browse files

Add new test: test_process_uptime

  • Loading branch information...
1 parent f965b9f commit 6a51f31bb23eae8f875b6817c1d626a98901bb47 @icy icy committed Jul 15, 2011
Showing with 10 additions and 5 deletions.
  1. +10 −5 test/test_system_process.rb
View
15 test/test_system_process.rb
@@ -5,26 +5,31 @@ 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
+
+ def test_process_uptime
+ assert_kind_of Float, @process.uptime
+ assert @process.uptime > 0
+ end
end

0 comments on commit 6a51f31

Please sign in to comment.