@@ -38,7 +38,7 @@ class PendingExampleFixedError < StandardError; end
38
38
# @param message [String] optional message to add to the summary report.
39
39
#
40
40
# @example
41
- # describe "an example " do
41
+ # describe "some behaviour " do
42
42
# # reported as "Pending: no reason given"
43
43
# it "is pending with no message" do
44
44
# pending
@@ -52,21 +52,13 @@ class PendingExampleFixedError < StandardError; end
52
52
# end
53
53
# end
54
54
#
55
- # @note `before(:example)` hooks are eval'd when you use the `pending`
56
- # method within an example. If you want to declare an example `pending`
57
- # and bypass the `before` hooks as well, you can pass `:pending => true`
58
- # to the `it` method:
59
- #
60
- # it "does something", :pending => true do
61
- # # ...
62
- # end
63
- #
64
- # or pass `:pending => "something else getting finished"` to add a
65
- # message to the summary report:
66
- #
67
- # it "does something", :pending => "something else getting finished" do
68
- # # ...
69
- # end
55
+ # @note When using `pending` inside an example body using this method
56
+ # hooks, such as `before(:example)`, have already be run. This means that
57
+ # a failure from the code in the `before` hook will prevent the example
58
+ # from being considered pending, as the example body would not be
59
+ # executed. If you need to consider hooks as pending as well you can use
60
+ # the pending metadata as an alternative, e.g.
61
+ # `it "does something", pending: "message"`.
70
62
def pending ( message = nil )
71
63
current_example = RSpec . current_example
72
64
0 commit comments