statsd-instrument is enabling the users to pass a lambda function to dynamically set the tags. The strict mode is allowing only nil, hash, or an array. This PR adds Proc as a valid class type for the strict mode.
I couldn't find tests for the strict class. I thought about duplicating the existing test test_statsd_count_with_tags_as_lambda forcing it to run under the strict mode, but it doesn't seem like a future-proof method of testing the strictness.
Adding the error log just to help seo/searchability.
FAIL
XXXXX_duration_via_StatsD
An exception occurred in the block provided to the StatsD assertion.
ArgumentError: The tags argument should be a hash or an array, got #<Proc:0x00007f01e0dd3770 /xxxxxxxx:43 (lambda)>
/xxxxxxxxx:101:in `check_tags_and_sample_rate'
/xxxxxxxxx:in `distribution'
statsd-instrument is enabling the users to pass a lambda function to dynamically set the tags. The
strict mode
is allowing onlynil
,hash
, or anarray
. This PR addsProc
as a valid class type for the strict mode.I couldn't find tests for the strict class. I thought about duplicating the existing test test_statsd_count_with_tags_as_lambda forcing it to run under the strict mode, but it doesn't seem like a future-proof method of testing the strictness.
Adding the error log just to help seo/searchability.