Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit c56f990

Browse files
committed
Just check for decimals instead of exactly 3
When checking 3 explicitly we sometimes get failures because 1.1.to_s is "1.1" instead of "1.10". According to vmg, one or more should be fine and we want more than 2 points of precision, so it is better to change the test than the implementation.
1 parent 220ed62 commit c56f990

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spec/statsd_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class << @statsd
7474
data = @statsd.shards.first.recv
7575
key, value, unit = data.first.split(/[:|]/)
7676
key.must_equal "foobar"
77-
value.must_match /^\d\.\d{3}$/
77+
value.must_match /^\d\.\d+$/
7878
unit.must_equal "ms"
7979
end
8080

@@ -91,7 +91,7 @@ class << @statsd
9191
data = @statsd.shards.first.recv
9292
key, value, unit, frequency = data.first.split(/[:|]/)
9393
key.must_equal "foobar"
94-
value.must_match /^\d\.\d{3}$/
94+
value.must_match /^\d\.\d+$/
9595
unit.must_equal "ms"
9696
frequency.must_equal "@0.5"
9797
end

0 commit comments

Comments
 (0)