Permalink
Browse files

Adding Float verfication.

  • Loading branch information...
1 parent 7eaee80 commit 8a01bb21f15fc8905b1142ee9677fbb022b232f0 @JEG2 committed Jun 18, 2008
Showing with 16 additions and 0 deletions.
  1. +16 −0 test/tc_fetch.rb
View
@@ -47,4 +47,20 @@ def test_example_data_from_tutorial
2 ** -20 )
end
end
+
+ def test_floats_are_supported
+ RRDB.config( :reserve_fields => 0,
+ :database_start => Time.at(920804400),
+ :data_sources => {:float => "GAUGE:600:U:U"},
+ :round_robin_archives => %w[AVERAGE:0.5:1:24] )
+
+ @db.update(Time.at(920804700), :float => 2.9)
+ @db.update(Time.at(920805000), :float => 2.9)
+
+ float = @db.fetch( :AVERAGE,
+ :start => Time.at(920804700),
+ :end => Time.at(920804700) ).values.first.values.first
+ assert_instance_of(Float, float)
+ assert_in_delta(2.9, float, 2 ** -20)
+ end
end

0 comments on commit 8a01bb2

Please sign in to comment.