Shopify / statsd-instrument

A StatsD client for Ruby apps. Provides metaprogramming methods to inject StatsD instrumentation into your code.
http://shopify.github.io/statsd-instrument
MIT License
570 stars 94 forks source link

Support using matcher in examples without a string #277

Closed tjsousa closed 3 years ago

tjsousa commented 3 years ago

Fixes an issue when trying to use the matchers in one line expectations without a string description.

This fix has been tested with rspec-has to write it like this:

it { has.to trigger_statsd_increment("metric") } 

Original error:

When you call a matcher in an example without a String, like this:

specify { expect(object).to matcher }

or this:

it { is_expected.to matcher }

RSpec expects the matcher to have a #description method. You should either
add a String to the example this matcher is being used in, or give it a
description method. Then you won't have to suffer this lengthy warning again.
wvanbergen commented 3 years ago

@tjsousa thanks for contributing. This looks good! However, before I can merge you'll need to sign Shopify's (pretty standard) contributor agreement.

tjsousa commented 3 years ago

Hi @wvanbergen, signed it. Anything else I would have to do?

wvanbergen commented 3 years ago

All good now, merging!