... | ... |
@@ -18,4 +18,13 @@ class Cpu_test < MiniTest::Unit::TestCase |
18 | 18 |
def test_cpu_load |
19 | 19 |
assert_match(/^\d\.\d{2}$/, @cpu.results()) |
20 | 20 |
end |
21 |
+ |
|
22 |
+ def test_notify? |
|
23 |
+ @cpu.load_options({notify_threshold: 0}) |
|
24 |
+ assert_equal(true, @cpu.notify?) |
|
25 |
+ |
|
26 |
+ #assume you have no more than 999 cpu load |
|
27 |
+ @cpu.load_options({notify_threshold: 999}) |
|
28 |
+ assert_equal(false, @cpu.notify?) |
|
29 |
+ end |
|
21 | 30 |
end |
22 | 31 |
\ No newline at end of file |