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
|
eb09be77 |
def test_labels
labels = @cpu.graph_labels |
01ff794e |
|
eb09be77 |
assert_equal("CPU Load", labels[:y_axis])
assert_match(/^CPU Load In Time \(CPUs: [\d]+\)$/, labels[:graph_name]) |
01ff794e |
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 |