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

Commit 66841dc

Browse files
committed
Merge pull request #2770 from jxa/add-feature-skip-with-metadata
Document the syntax for providing a skip reason in metadata
1 parent fa2c384 commit 66841dc

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

features/pending_and_skipped_examples/skipped_examples.feature

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,24 @@ Feature: `skip` examples
110110
# No reason given
111111
# ./skipped_spec.rb:2
112112
"""
113+
114+
Scenario: Skipping using metadata with a reason
115+
Given a file named "skipped_with_reason_spec.rb" with:
116+
"""ruby
117+
RSpec.describe "an example" do
118+
example "is skipped", :skip => "waiting for planets to align" do
119+
raise "this line is never executed"
120+
end
121+
end
122+
"""
123+
When I run `rspec skipped_with_reason_spec.rb`
124+
Then the exit status should be 0
125+
And the output should contain "1 example, 0 failures, 1 pending"
126+
And the output should contain:
127+
"""
128+
Pending: (Failures listed here are expected and do not affect your suite's status)
129+
130+
1) an example is skipped
131+
# waiting for planets to align
132+
# ./skipped_with_reason_spec.rb:2
133+
"""

0 commit comments

Comments
 (0)