Method: RSpec::Core::Pending#skip

Defined in:
lib/rspec/core/pending.rb

#skipvoid #skip(message) ⇒ void

Marks an example as pending and skips execution.

Examples:

describe "an example" do
  # reported as "Pending: no reason given"
  it "is skipped with no message" do
    skip
  end

  # reported as "Pending: something else getting finished"
  it "is skipped with a custom message" do
    skip "something else getting finished"
  end
end

Parameters:

  • message (String) (defaults to: nil)

    optional message to add to the summary report.

Raises:


110
111
112
113
114
115
116
# File 'lib/rspec/core/pending.rb', line 110

def skip(message=nil)
  current_example = RSpec.current_example

  Pending.mark_skipped!(current_example, message) if current_example

  raise SkipDeclaredInExample.new(message)
end