Module: RSpec::Core::Pending

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

Instance Method Summary collapse

Instance Method Details

#pending(message = 'No reason given') ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/rspec/core/pending.rb', line 4

def pending(message = 'No reason given')
  example.[:pending] = true
  example.[:execution_result][:pending_message] = message
  if block_given?
    begin
      result = yield
      example.[:pending] = false
    rescue Exception => e
    end
    raise RSpec::Core::PendingExampleFixedError.new if result
  end
  throw :pending_declared_in_example, message
end