diff options
author | Robert Speicher <rspeicher@gmail.com> | 2012-08-29 01:49:26 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2012-08-29 10:44:34 -0400 |
commit | 14daf2e2ba9d75527b5de07d87a9027bd53d607e (patch) | |
tree | f9aad03d997712e8dff38501663730fbdb166360 | |
parent | 2c95074a5faec5e5420bfbf87134f5956d427cd1 (diff) | |
download | gitlab-ce-14daf2e2ba9d75527b5de07d87a9027bd53d607e.tar.gz |
Add `include_module` matcher
-rw-r--r-- | spec/support/matchers.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb index e0672166e92..14a03870a6c 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) |