test/unit/gauge_test.rb in harness-0.3.0 vs test/unit/gauge_test.rb in harness-0.4.0
- old
+ new
@@ -63,9 +63,19 @@
gauge = Harness::Gauge.from_event event
assert_equal 'foo', gauge.id
end
+ def test_sets_value_from_payload_if_number
+ base = Time.now
+
+ event = ActiveSupport::Notifications::Event.new "name", base - 1, Time.now, nil, :gauge => {value: 42}
+
+ gauge = Harness::Gauge.from_event event
+
+ assert_equal 42, gauge.value
+ end
+
def test_initializes_time_if_not_set
gauge = Harness::Gauge.new
assert gauge.time
end