Browse code

Dummy output class

Cinan Rakosnik authored on 17/12/2012 at 02:35:44
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,9 @@
0
+module Rubysermon
1
+	class Dummy < OutputDriverTemplate
2
+
3
+		def log(mod, mod_results)
4
+			puts "Time: #{mod_results[:time]}; Mod: #{mod}; Value: #{mod_results[:value]}"
5
+		end
6
+
7
+	end
8
+end
0 9
\ No newline at end of file
1 10
new file mode 100644
... ...
@@ -0,0 +1,16 @@
0
+require_relative "../../../test_helper.rb"
1
+require Rubysermon::LIB_PATH + "/rubysermon/output_drivers/dummy"
2
+
3
+class Dummy_test < MiniTest::Unit::TestCase
4
+
5
+	def setup
6
+		@logger = Rubysermon::Dummy.new
7
+	end
8
+
9
+	def test_log
10
+		assert_output("Time: 2012-12-17 03:29:34; Mod: mod; Value: 13.37\n") do
11
+			@logger.log("mod", {time: "2012-12-17 03:29:34", value: 13.37})
12
+		end
13
+	end
14
+
15
+end
0 16
\ No newline at end of file