You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/contributors/architecture/how-rspec-works.md
+33-29Lines changed: 33 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,7 +86,7 @@ First, we will review several concepts in RSpec: [^fn1]
86
86
The default formatter is "progress",
87
87
[set in the configuration object][rspec-default-formatter-set],
88
88
which maps to an instance of [`RSpec::Core::Formatters::ProgressFormatter`](https://github.com/rspec/rspec-core/blob/v3.13.0/lib/rspec/core/formatters/progress_formatter.rb).
[calls the `matches?` method on the matcher][rspec-positive-expectation-handler-matcher-matches].
138
-
1. Assuming that `matches?` returns false,
139
-
`PositiveExpectationHandler` then [calls `RSpec::Expectations::ExpectationHelper.handle_failure`][rspec-expectation-helper-handle-failure-call-positive],
140
-
telling it to get the positive failure message from the matcher
141
-
by calling `failure_message`.
142
-
- If the assertion is negative:
143
-
1. Within the test,
144
-
after `expect` is called to build a `RSpec::Expectations::ExpectationTarget`,
[calls the `does_not_match?` method on the matcher][rspec-negative-expectation-handler-matcher-does-not-match].
150
-
1. Assuming that `does_not_match?` returns false,
151
-
`NegativeExpectationHandler` then [calls `RSpec::Expectations::ExpectationHelper.handle_failure`][via `NegativeExpectationHandler`][rspec-expectation-helper-handle-failure-call-negative],
152
-
telling it to get the negative failure message from the matcher
153
-
by calling `failure_message_when_negated`.
132
+
- If the assertion is positive:
133
+
1. Within the test,
134
+
after `expect` is called to build a `RSpec::Expectations::ExpectationTarget`,
[calls the `matches?` method on the matcher][rspec-positive-expectation-handler-matcher-matches].
140
+
1. Assuming that `matches?` returns false,
141
+
`PositiveExpectationHandler` then [calls `RSpec::Expectations::ExpectationHelper.handle_failure`][rspec-expectation-helper-handle-failure-call-positive],
142
+
telling it to get the positive failure message from the matcher
143
+
by calling `failure_message`.
144
+
- If the assertion is negative:
145
+
1. Within the test,
146
+
after `expect` is called to build a `RSpec::Expectations::ExpectationTarget`,
[calls the `does_not_match?` method on the matcher][rspec-negative-expectation-handler-matcher-does-not-match].
152
+
1. Assuming that `does_not_match?` returns false,
153
+
`NegativeExpectationHandler` then [calls `RSpec::Expectations::ExpectationHelper.handle_failure`][via `NegativeExpectationHandler`][rspec-expectation-helper-handle-failure-call-negative],
154
+
telling it to get the negative failure message from the matcher
0 commit comments