module RSpec::Core::Pending

def pending(*args)

Other tags:
    Note: - `before(:each)` hooks are eval'd when you use the `pending`

Parameters:
  • block (Block) -- optional block. If it fails, the example is
  • message (String) -- optional message to add to the summary report.

Overloads:
  • pending(message, &block)
  • pending(message)
  • pending()
def pending(*args)
  return self.class.before(:each) { pending(*args) } unless example
  options = args.last.is_a?(Hash) ? args.pop : {}
  message = args.first || NO_REASON_GIVEN
  if options[:unless] || (options.has_key?(:if) && !options[:if])
    return block_given? ? yield : nil
  end
  example.metadata[:pending] = true
  example.metadata[:execution_result][:pending_message] = message
  if block_given?
    begin
      result = begin
                 yield
                 example.example_group_instance.instance_eval { verify_mocks_for_rspec }
                 true
               end
      example.metadata[:pending] = false
    rescue Exception => e
      example.execution_result[:exception] = e
    ensure
      teardown_mocks_for_rspec
    end
    raise PendingExampleFixedError.new if result
  end
  raise PendingDeclaredInExample.new(message)
end