This allows to mix positive and negative expectations, meaning user is able to assert that a given metric is not present while checking for the presence of others.
foo_1_metric = StatsD::Instrument::Expectation.increment("counter", times: 2, tags: ["foo:1"])
foo_2_metric = StatsD::Instrument::Expectation.increment("counter", times: 0, tags: ["foo:2"])
assert_statsd_expectations([foo_1_metric, foo_2_metric]) do
...
end
Without this change, if user passes times: 0 as expectation the test does not fail and the metric is not checked to make sure it was not called, given an impression to the user that the feature is available.
This allows to mix positive and negative expectations, meaning user is able to assert that a given metric is not present while checking for the presence of others.
Without this change, if user passes
times: 0
as expectation the test does not fail and the metric is not checked to make sure it was not called, given an impression to the user that the feature is available.