Browse code

Change mod template

Cinan Rakosnik authored on 16/12/2012 at 03:26:45
Showing 3 changed files
... ...
@@ -25,12 +25,11 @@ module Rubysermon
25 25
 			@cpu_load >= @options[:notify_threshold].to_i
26 26
 		end
27 27
 
28
-		def y_axis_name
29
-			@y_axis
30
-		end
31
-
32
-		def graph_name
33
-			"#@graph_name (CPUs: #@cpu_count)"
28
+		def graph_labels
29
+			{
30
+				y_axis: @y_axis,
31
+				graph_name: "#@graph_name (CPUs: #@cpu_count)"
32
+			}
34 33
 		end
35 34
 	end
36 35
 end
37 36
\ No newline at end of file
... ...
@@ -17,11 +17,7 @@ module Rubysermon
17 17
 			throw Rubysermon::ModTemplateException
18 18
 		end
19 19
 
20
-		def y_axis_name
21
-			throw Rubysermon::ModTemplateException
22
-		end
23
-
24
-		def graph_name
20
+		def graph_labels
25 21
 			throw Rubysermon::ModTemplateException
26 22
 		end
27 23
 
... ...
@@ -7,12 +7,11 @@ class Cpu_test < MiniTest::Unit::TestCase
7 7
 		@cpu = Rubysermon::Cpu.new
8 8
 	end
9 9
 
10
-	def test_y_axis
11
-		assert_equal("CPU Load", @cpu.y_axis_name)
12
-	end
10
+	def test_labels
11
+		labels = @cpu.graph_labels
13 12
 
14
-	def test_graph_name
15
-		assert_match(/^CPU Load In Time \(CPUs: [\d]+\)$/, @cpu.graph_name)
13
+		assert_equal("CPU Load", labels[:y_axis])
14
+		assert_match(/^CPU Load In Time \(CPUs: [\d]+\)$/, labels[:graph_name])
16 15
 	end
17 16
 
18 17
 	def test_cpu_load