vendor/plugins/rspec/lib/spec/example/errors.rb in spree-0.5.1 vs vendor/plugins/rspec/lib/spec/example/errors.rb in spree-0.6.0

- old
+ new

@@ -1,9 +1,30 @@ module Spec module Example class ExamplePendingError < StandardError - end + attr_reader :pending_caller - class PendingExampleFixedError < StandardError + 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 + end + + class PendingExampleFixedError < StandardError; end end end