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

Document the syntax for providing a skip reason in metadata #2770

Merged
merged 1 commit into from
Sep 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions features/pending_and_skipped_examples/skipped_examples.feature
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,24 @@ Feature: `skip` examples
# No reason given
# ./skipped_spec.rb:2
"""

Scenario: Skipping using metadata with a reason
Given a file named "skipped_with_reason_spec.rb" with:
"""ruby
RSpec.describe "an example" do
example "is skipped", :skip => "waiting for planets to align" do
raise "this line is never executed"
end
end
"""
When I run `rspec skipped_with_reason_spec.rb`
Then the exit status should be 0
And the output should contain "1 example, 0 failures, 1 pending"
And the output should contain:
"""
Pending: (Failures listed here are expected and do not affect your suite's status)

1) an example is skipped
# waiting for planets to align
# ./skipped_with_reason_spec.rb:2
"""