We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f00217 commit d3edf25Copy full SHA for d3edf25
1 file changed
lib/mspec/matchers/base.rb
@@ -36,6 +36,14 @@ def equal?(expected)
36
end
37
38
39
+ def raise(exception = Exception, message = nil, options = nil, &block)
40
+ matcher = ::RaiseErrorMatcher.new(exception, message, options, &block)
41
+ unless matcher.matches? @actual
42
+ expected, actual = matcher.failure_message
43
+ ::SpecExpectation.fail_with(expected, actual)
44
+ end
45
46
+
47
def method_missing(name, *args, &block)
48
result = @actual.__send__(name, *args, &block)
49
unless result
@@ -70,6 +78,14 @@ def equal?(expected)
70
78
71
79
72
80
81
82
83
+ if matcher.matches? @actual
84
+ expected, actual = matcher.negative_failure_message
85
86
87
88
73
89
74
90
75
91
if result
0 commit comments