sys-cpu 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
data/test/tc_cpu.rb DELETED
@@ -1,17 +0,0 @@
1
- $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__))
2
- require 'tc_version'
3
-
4
- case RUBY_PLATFORM
5
- when /bsd|darwin|mach|osx/i
6
- require 'tc_bsd'
7
- when /hpux/i
8
- require 'tc_hpux'
9
- when /linux/i
10
- require 'tc_linux'
11
- when /sunos|solaris/i
12
- require 'tc_sunos'
13
- when /mswin|win32|dos|mingw|cygwin/i
14
- require 'tc_windows'
15
- else
16
- raise "Platform not supported"
17
- end
data/test/tc_linux.rb DELETED
@@ -1,34 +0,0 @@
1
- ###########################################################
2
- # tc_linux.rb
3
- #
4
- # Test Suite for sys-cpu for Linux. This should be run via
5
- # the 'rake test' task.
6
- ###########################################################
7
- require "sys/cpu"
8
- require "test/unit"
9
- require "tc_version"
10
- include Sys
11
-
12
- class TC_Linux < Test::Unit::TestCase
13
- def test_all_dynamic_methods
14
- assert_nothing_raised{
15
- CPU.processors{ |cs|
16
- cs.members.each{ |m|
17
- puts "#{m}: " + cs[m].to_s
18
- }
19
- }
20
- }
21
- end
22
-
23
- def test_load_avg
24
- assert_nothing_raised{ CPU.load_avg }
25
- assert_equal(3, CPU.load_avg.length)
26
- end
27
-
28
- def test_cpu_stats
29
- assert_nothing_raised{ CPU.cpu_stats }
30
- assert_kind_of(Hash, CPU.cpu_stats)
31
- assert_equal(true, CPU.cpu_stats["cpu0"].length >= 4)
32
- end
33
- end
34
-