lib/mocktail/share/cleans_backtrace.rb in mocktail-1.2.3 vs lib/mocktail/share/cleans_backtrace.rb in mocktail-2.0.0

- old
+ new

@@ -1,16 +1,14 @@ -require "pathname" - module Mocktail class CleansBacktrace - BASE_PATH = (Pathname.new(__FILE__) + "../../..").to_s + extend T::Sig def clean(error) raise error - rescue => e + rescue error.class => e e.tap do |e| e.set_backtrace(e.backtrace.drop_while { |frame| - frame.start_with?(BASE_PATH) + frame.start_with?(BASE_PATH, BASE_PATH) || frame.match?(/[\\|\/]sorbet-runtime.*[\\|\/]lib[\\|\/]types[\\|\/]private/) }) end end end end