Can I use a built-in RSpec matcher in a custom matcher?
<p>I have the following expectation in a feature spec (pretty low-level but still necessary):</p>

<pre><code>expect(Addressable::URI.parse(current_url).query_values).to include(
  'some =&gt; 'value',
  'some_other' =&gt; String
)
</code></pre>

<p>Note the second query value is a fuzzy match because I just want to make sure it's there but I can't be more specific about it.</p>

<p>I'd like to extract this into a custom matcher. I started with:</p>

<pre><code>RSpec::Matchers.define :have_query_params do |expected_params|
  match do |url|
    Addressable::URI.parse(url).query_values == expected_params
  end
end
</code></pre>

<p>but this means I cannot pass <code>{'some_other' =&gt; String}</code> in there. To keep using a fuzzy match, I'd have to use the <code>include</code> matcher in my custom matcher.</p>

<p>However, anything within <code>RSpec::Matchers::BuiltIn</code> is marked as private API, and <code>Include</code> specifically is <a href="https://github.com/rspec/rspec-expectations/blob/e8e90cce3dfddab3ecd5b3c98559d384530daf8d/lib/rspec/matchers/built_in/include.rb#L5-L6" rel="noreferrer">documented</a> as:</p>

<pre><code># Provides the implementation for `include`.
# Not intended to be instantiated directly.
</code></pre>

<p>So, my question is: <strong>Is using a built-in matcher within a custom matcher supported in RSpec?</strong> How would I do that?</p>