@@ -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 "some behaviour " do
41
+ # describe "an example " do
42
42
# # reported as "Pending: no reason given"
43
43
# it "is pending with no message" do
44
44
# pending
@@ -52,42 +52,21 @@ class PendingExampleFixedError < StandardError; end
52
52
# end
53
53
# end
54
54
#
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:
56
59
#
57
- # describe "SomeClass" do
58
- # pending "does not implement something yet" do
60
+ # it "does something", :pending => true do
59
61
# # ...
60
62
# 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:
70
63
#
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:
87
66
#
88
- # pending 'is considered pending' do
89
- # not_implemented
90
- # end
67
+ # it "does something", : pending => "something else getting finished" do
68
+ # # ...
69
+ # end
91
70
def pending ( message = nil )
92
71
current_example = RSpec . current_example
93
72
0 commit comments