Sha256: 741bc5431b4f9073d87d0569f45761204711026bad66b9f7ea7c98803c316e7f

Contents?: true

Size: 779 Bytes

Versions: 8

Compression:

Stored size: 779 Bytes

Contents

module Spec
  module Example
    class ExamplePendingError < StandardError
      attr_reader :pending_caller

      def initialize(message=nil, pending_caller=nil)
        super(message)
        @pending_caller = 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

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
dchelimsky-rspec-1.1.99.13 lib/spec/example/errors.rb
dchelimsky-rspec-1.1.99.6 lib/spec/example/errors.rb
dchelimsky-rspec-1.1.99.7 lib/spec/example/errors.rb
dchelimsky-rspec-1.1.99.8 lib/spec/example/errors.rb
dchelimsky-rspec-1.1.99.9 lib/spec/example/errors.rb
rspec-1.2.2 lib/spec/example/errors.rb
rspec-1.2.1 lib/spec/example/errors.rb
rspec-1.2.0 lib/spec/example/errors.rb