Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 984b6ba

Browse files
committed
fixup! Revert doc changes for pending.rb
1 parent c9e41f1 commit 984b6ba

File tree

1 file changed

+11
-32
lines changed

1 file changed

+11
-32
lines changed

lib/rspec/core/pending.rb

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class PendingExampleFixedError < StandardError; end
3838
# @param message [String] optional message to add to the summary report.
3939
#
4040
# @example
41-
# describe "some behaviour" do
41+
# describe "an example" do
4242
# # reported as "Pending: no reason given"
4343
# it "is pending with no message" do
4444
# pending
@@ -52,42 +52,21 @@ class PendingExampleFixedError < StandardError; end
5252
# end
5353
# end
5454
#
55-
# @example Alternatively, you can use the `pending` example alias method:
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:
5659
#
57-
# describe "SomeClass" do
58-
# pending "does not implement something yet" do
60+
# it "does something", :pending => true do
5961
# # ...
6062
# end
61-
# end
62-
#
63-
# or specify metadata on an example:
64-
#
65-
# it "does this", :pending => "is not yet implemented" do
66-
# # ...
67-
# end
68-
#
69-
# even without an explicit pending message:
7063
#
71-
# it "does something", :pending do
72-
# # ...
73-
# end
74-
#
75-
# @note There is a difference between using `pending` inside the example
76-
# body and `pending` example group alias/`pending` metadata. In the case
77-
# when the failure is caused by the code in the `before` hook, the example
78-
# would not be considered pending, as the example body wouldn't be reached.
79-
# If you intend the failure in the `before` hook to be considered a part
80-
# of the example, use the latter.
81-
#
82-
# @example Failure in `before` hook causes the example to fail
83-
# before { fail 'BOOM' }
84-
# it 'fails' do
85-
# pending 'this never gets executed'
86-
# end
64+
# or pass `:pending => "something else getting finished"` to add a
65+
# message to the summary report:
8766
#
88-
# pending 'is considered pending' do
89-
# not_implemented
90-
# end
67+
# it "does something", :pending => "something else getting finished" do
68+
# # ...
69+
# end
9170
def pending(message=nil)
9271
current_example = RSpec.current_example
9372

0 commit comments

Comments
 (0)