Sha256: 60f4c0bfa26a7936627c84e4f225ca9ea8b7e2671462ab9741fc885e81f7afe8
Contents?: true
Size: 1.99 KB
Versions: 2
Compression:
Stored size: 1.99 KB
Contents
###################################################################### # tc_windows.rb # # Test suite for MS Windows systems. This should be run via the # 'rake test' task. ###################################################################### require "test/unit" require "sys/cpu" require "tc_version" require "socket" include Sys class TC_Windows_CPU < Test::Unit::TestCase def setup @host = Socket.gethostname end def test_architecture assert_respond_to(CPU, :architecture) assert_nothing_raised{ CPU.architecture } assert_nothing_raised{ CPU.architecture(@host) } assert_kind_of(String, CPU.architecture, "Invalid Type") end def test_freq assert_respond_to(CPU, :freq) assert_nothing_raised{ CPU.freq } assert_nothing_raised{ CPU.freq(0) } assert_nothing_raised{ CPU.freq(0, @host) } assert_kind_of(Integer, CPU.freq, "Invalid Type") end def test_model assert_respond_to(CPU, :model) assert_nothing_raised{ CPU.model } assert_nothing_raised{ CPU.model(@host) } assert_kind_of(String, CPU.model, "Invalid Type") end def test_num_cpu assert_respond_to(CPU, :num_cpu) assert_nothing_raised{ CPU.num_cpu } assert_nothing_raised{ CPU.num_cpu(@host) } assert_kind_of(Integer, CPU.num_cpu, "Invalid Type") end def test_type assert_respond_to(CPU, :type) assert_nothing_raised{ CPU.type } assert_nothing_raised{ CPU.type(@host) } assert_kind_of(String, CPU.type, "Invalid Type") end def test_load_avg assert_respond_to(CPU, :load_avg) assert_nothing_raised{ CPU.load_avg } assert_nothing_raised{ CPU.load_avg(0, @host) } assert_kind_of(Integer, CPU.load_avg, "Invalid Type") end def test_processors assert_respond_to(CPU, :processors) assert_nothing_raised{ CPU.processors{} } end def teardown @host = nil end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
sys-cpu-0.6.0-mswin32 | test/tc_windows.rb |
sys-cpu-0.6.1-x86-mswin32-60 | test/tc_windows.rb |