diff --git a/spec/lib/banzai/filter/syntax_highlight_filter_spec.rb b/spec/lib/banzai/filter/syntax_highlight_filter_spec.rb
index 50be175c1c3b1958223cb374b5a0b7dc75a4ea99..48ebc81cf829f9848c86f9babf5d8c7ea6a36238 100644
--- a/spec/lib/banzai/filter/syntax_highlight_filter_spec.rb
+++ b/spec/lib/banzai/filter/syntax_highlight_filter_spec.rb
@@ -9,7 +9,7 @@ describe Banzai::Filter::SyntaxHighlightFilter, lib: true do
   end
 
   it 'passes through invalid code blocks' do
-    allow_any_instance_of(described_class).to receive(:block_code).and_raise(StandardError)
+    allow_any_instance_of(Rouge::Formatter).to receive(:format).and_raise(StandardError)
 
     result = filter('<pre><code>This is a test</code></pre>')
     expect(result.to_html).to eq('<pre>This is a test</pre>')