From 14daf2e2ba9d75527b5de07d87a9027bd53d607e Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Wed, 29 Aug 2012 01:49:26 -0400 Subject: [PATCH] Add `include_module` matcher --- spec/support/matchers.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb index e0672166..14a03870 100644 --- a/spec/support/matchers.rb +++ b/spec/support/matchers.rb @@ -28,6 +28,16 @@ RSpec::Matchers.define :be_404_for do |user| end end +RSpec::Matchers.define :include_module do |expected| + match do + described_class.included_modules.include?(expected) + end + + failure_message_for_should do + "expected #{described_class} to include the #{expected} module" + end +end + module UrlAccess def url_allowed?(user, url) emulate_user(user)