Skip to content

Commit

Permalink
fix tests for portable poller
Browse files Browse the repository at this point in the history
  • Loading branch information
mojombo committed May 14, 2008
1 parent 4f12e1c commit b3b55b5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
17 changes: 17 additions & 0 deletions 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

12 changes: 0 additions & 12 deletions test/test_system_process.rb
Expand Up @@ -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

0 comments on commit b3b55b5

Please sign in to comment.