Sha256: 8b9b9c97bbad1d988d71b026dee06aae49094255ccdb399baf765f8fb7fd569d
Contents?: true
Size: 1.3 KB
Versions: 3
Compression:
Stored size: 1.3 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? end config.after(:example) do |example| unless example.exception expect(PryDebugger.breakpoints.count).to be(0), "not all breakpoints launched: #{PryDebugger.breakpoints.count}" 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
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
pry-moves-1.0.2 | spec/spec_helper.rb |
pry-moves-1.0.1 | spec/spec_helper.rb |
pry-moves-1.0.0 | spec/spec_helper.rb |