From b3b55b5794e816d1b20e7a6908551f2430d7403f Mon Sep 17 00:00:00 2001 From: Tom Preston-Werner Date: Tue, 13 May 2008 22:08:49 -0700 Subject: [PATCH] fix tests for portable poller --- test/test_system_portable_poller.rb | 17 +++++++++++++++++ test/test_system_process.rb | 12 ------------ 2 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 test/test_system_portable_poller.rb diff --git a/test/test_system_portable_poller.rb b/test/test_system_portable_poller.rb new file mode 100644 index 00000000..f3f78516 --- /dev/null +++ b/test/test_system_portable_poller.rb @@ -0,0 +1,17 @@ +require File.dirname(__FILE__) + '/helper' + +class TestSystemPortablePoller < Test::Unit::TestCase + def setup + pid = Process.pid + @process = System::PortablePoller.new(pid) + end + + def test_time_string_to_seconds + assert_equal 0, @process.bypass.time_string_to_seconds('0:00:00') + assert_equal 0, @process.bypass.time_string_to_seconds('0:00:55') + assert_equal 27, @process.bypass.time_string_to_seconds('0:27:32') + assert_equal 75, @process.bypass.time_string_to_seconds('1:15:13') + assert_equal 735, @process.bypass.time_string_to_seconds('12:15:13') + end +end + diff --git a/test/test_system_process.rb b/test/test_system_process.rb index b62786a9..9f1411a8 100644 --- a/test/test_system_process.rb +++ b/test/test_system_process.rb @@ -26,17 +26,5 @@ def test_percent_memory def test_percent_cpu assert_kind_of Float, @process.percent_cpu end - - def test_cpu_time - assert_kind_of Integer, @process.cpu_time - end - - def test_time_string_to_seconds - assert_equal 0, @process.bypass.time_string_to_seconds('0:00:00') - assert_equal 0, @process.bypass.time_string_to_seconds('0:00:55') - assert_equal 27, @process.bypass.time_string_to_seconds('0:27:32') - assert_equal 75, @process.bypass.time_string_to_seconds('1:15:13') - assert_equal 735, @process.bypass.time_string_to_seconds('12:15:13') - end end