Module: Spec::Example::Pending

Included in:
ExampleMethods, Story::World
Defined in:
lib/gems/rspec-1.1.12/lib/spec/example/pending.rb

Instance Method Summary collapse

Instance Method Details

#pending(message = "TODO") ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/gems/rspec-1.1.12/lib/spec/example/pending.rb', line 4

def pending(message = "TODO")
  if block_given?
    begin
      yield
    rescue Exception => e
      raise Spec::Example::ExamplePendingError.new(message)
    end
    raise Spec::Example::PendingExampleFixedError.new("Expected pending '#{message}' to fail. No Error was raised.")
  else
    raise Spec::Example::ExamplePendingError.new(message)
  end
end