Sha256: d56dce5bf4f920394b7a41a04d36aa863aa3ef2e92b6b2c2229b85dcb60b267e
Contents?: true
Size: 1.39 KB
Versions: 13
Compression:
Stored size: 1.39 KB
Contents
$VERBOSE = nil # Disable warnings for whole specs require 'pry' require_relative 'pry_debugger' require_relative '../playground/playground.rb' PryDebugger.inject unless ENV['DEBUG'] RSpec.configure do |config| config.include PryDebugger::Breakpoints config.before(:example) do PryMoves.unlock if PryMoves.semaphore.locked? PryMoves.step_in_everywhere = false end config.after(:example) do |example| unless example.exception expect(PryDebugger.breakpoints.count).to be(0), "not all breakpoints launched, left to launch: #{PryDebugger.breakpoints.count}. All following specs may fail." end end end RSpec::Core::BacktraceFormatter.class_eval do alias :native_backtrace_line :backtrace_line def format_backtrace(backtrace, options={}) return [] unless backtrace return backtrace if options[:full_backtrace] || backtrace.empty? @lines = 0 backtrace.map { |l| backtrace_line(l) }.compact end FILTER = /(\/gems\/|\/lib\/pry\/|spec\/pry_debugger\.rb)/ def backtrace_line(line) unless ENV['TRACE'] return if @lines == 3 #return if line.match FILTER return unless line.include? '/playground.rb' end result = native_backtrace_line(line) if result @lines += 1 if @lines result[0 .. 1] == './' ? result[2 .. -1] : result end end end Pry::REPL.class_eval do def handle_read_errors yield end end
Version data entries
13 entries across 13 versions & 1 rubygems