Sha256: 85329bad3d26eb178ba05b7aafbfc31eed089fbd185d2592a7f2b1d0fc301a4a

Contents?: true

Size: 453 Bytes

Versions: 1

Compression:

Stored size: 453 Bytes

Contents

module Spec
  module Runner
    class BacktraceTweaker
      def tweak_backtrace error, spec_name
        return if error.backtrace.nil?
        tweaked_backtrace = []
        error.backtrace.each do |line|
          if line.include?('__instance_exec')
            line = line.split(':in')[0] + ":in `#{spec_name}'"
          end
          tweaked_backtrace.push line
        end
        error.set_backtrace tweaked_backtrace
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rspec-0.5.0 lib/spec/runner/backtrace_tweaker.rb