Skip to content

Commit 46f800d

Browse files
committed
Deprecate raise_exception in favor of raise_error
1 parent d87f746 commit 46f800d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/mspec/matchers/raise_error.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require 'mspec/utils/deprecate'
2+
13
class RaiseErrorMatcher
24
def initialize(exception, message, &block)
35
@exception = exception
@@ -62,5 +64,8 @@ def raise_error(exception=Exception, message=nil, &block)
6264
RaiseExceptionMatcher = RaiseErrorMatcher
6365

6466
class Object
65-
alias_method :raise_exception, :raise_error
67+
def raise_exception(exception=Exception, message=nil, &block)
68+
MSpec.deprecate "raise_exception", "raise_error"
69+
raise_error(exception, message, &block)
70+
end
6671
end

0 commit comments

Comments
 (0)