01ff794e | require_relative "../../../test_helper.rb" require Rubysermon::MOD_PATH + "/cpu.rb" class Cpu_test < MiniTest::Unit::TestCase def setup @cpu = Rubysermon::Cpu.new end def test_y_axis assert_equal("CPU Load", @cpu.y_axis_name) end def test_graph_name assert_match(/^CPU Load In Time \(CPUs: [\d]+\)$/, @cpu.graph_name) end |
4bf9b346 | def test_cpu_load |
41b3979f | assert_match(/^\d\.\d{1,2}$/, @cpu.results().to_s) |
4bf9b346 | end |
d7f5c0aa | def test_notify? @cpu.load_options({notify_threshold: 0}) assert_equal(true, @cpu.notify?) #assume you have no more than 999 cpu load @cpu.load_options({notify_threshold: 999}) assert_equal(false, @cpu.notify?) end |
01ff794e | end |