diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -67,3 +67,9 @@ def inspect_source(cop, file, source)
   ast, tokens = Rubocop::CLI.rip_source(source.join("\n"))
   cop.inspect(file, source, tokens, ast)
 end
+
+class Rubocop::Cop::Cop
+  def messages
+    offences.map(&:message)
+  end
+end
Add messages method to Cop in specs only