2008-06-18 02:57:57 -04:00
|
|
|
module Spec
|
|
|
|
|
module Example
|
|
|
|
|
class ExamplePendingError < StandardError
|
2008-11-29 12:00:06 -05:00
|
|
|
attr_reader :pending_caller
|
2008-06-18 02:57:57 -04:00
|
|
|
|
2008-11-29 12:00:06 -05:00
|
|
|
def initialize(message=nil)
|
|
|
|
|
super
|
|
|
|
|
@pending_caller = caller[2]
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
class NotYetImplementedError < ExamplePendingError
|
|
|
|
|
MESSAGE = "Not Yet Implemented"
|
|
|
|
|
RSPEC_ROOT_LIB = File.expand_path(File.dirname(__FILE__) + "/../..")
|
|
|
|
|
|
|
|
|
|
def initialize(backtrace)
|
|
|
|
|
super(MESSAGE)
|
|
|
|
|
@pending_caller = pending_caller_from(backtrace)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
|
|
def pending_caller_from(backtrace)
|
|
|
|
|
backtrace.detect {|line| !line.include?(RSPEC_ROOT_LIB) }
|
|
|
|
|
end
|
2008-06-18 02:57:57 -04:00
|
|
|
end
|
2008-11-29 12:00:06 -05:00
|
|
|
|
|
|
|
|
class PendingExampleFixedError < StandardError; end
|
2008-06-18 02:57:57 -04:00
|
|
|
end
|
|
|
|
|
end
|