/code></pre></div><h2 id="rspec" tabindex="-1">RSpec <a class="header-anchor" href="#rspec" aria-label="Permalink to &quot;RSpec&quot;">‚Äã</a></h2><p>If you are testing the <code>Ability</code> class through RSpec there is a <code>be_able_to</code> matcher available. This checks if the <code>can?</code> method returns <code>true</code>.</p><div class="language-ruby vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ruby</span><pre class="shiki shiki-themes github-ligh