parent
a6c8817d7d
commit
dd56251fea
@ -0,0 +1,33 @@
|
|||||||
|
From 68fae17f1439a3ad29453cf10951bd3b5131fd6f Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
|
||||||
|
Date: Wed, 27 Feb 2019 15:40:37 +0100
|
||||||
|
Subject: [PATCH] Respect Ruby configuration when filtering backtrace.
|
||||||
|
|
||||||
|
The Ruby might be configured to be installed into various locations. Be
|
||||||
|
smarter about filtering backtrace to properly remove all traces of
|
||||||
|
standard library.
|
||||||
|
|
||||||
|
Fixes #1341.
|
||||||
|
---
|
||||||
|
spec/cucumber/formatter/backtrace_filter_spec.rb | 4 +++-
|
||||||
|
1 files changed, 3 insertions(+), 1 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/spec/cucumber/formatter/backtrace_filter_spec.rb b/spec/cucumber/formatter/backtrace_filter_spec.rb
|
||||||
|
index f51748a5..27563a63 100644
|
||||||
|
--- a/spec/cucumber/formatter/backtrace_filter_spec.rb
|
||||||
|
+++ b/spec/cucumber/formatter/backtrace_filter_spec.rb
|
||||||
|
@@ -14,8 +14,10 @@ module Cucumber
|
||||||
|
_anything__minitest__anything_
|
||||||
|
_anything__test/unit__anything_
|
||||||
|
_anything__Xgem/ruby__anything_
|
||||||
|
- _anything__lib/ruby/__anything_
|
||||||
|
_anything__.rbenv/versions/2.3/bin/bundle__anything_)
|
||||||
|
+ trace << "_anything__#{RbConfig::CONFIG['rubyarchdir']}__anything_"
|
||||||
|
+ trace << "_anything__#{RbConfig::CONFIG['rubylibdir']}__anything_"
|
||||||
|
+
|
||||||
|
@exception = Exception.new
|
||||||
|
@exception.set_backtrace(trace)
|
||||||
|
end
|
||||||
|
--
|
||||||
|
2.20.1
|
||||||
|
|
@ -0,0 +1,41 @@
|
|||||||
|
From 68fae17f1439a3ad29453cf10951bd3b5131fd6f Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
|
||||||
|
Date: Wed, 27 Feb 2019 15:40:37 +0100
|
||||||
|
Subject: [PATCH] Respect Ruby configuration when filtering backtrace.
|
||||||
|
|
||||||
|
The Ruby might be configured to be installed into various locations. Be
|
||||||
|
smarter about filtering backtrace to properly remove all traces of
|
||||||
|
standard library.
|
||||||
|
|
||||||
|
Fixes #1341.
|
||||||
|
---
|
||||||
|
lib/cucumber/formatter/backtrace_filter.rb | 6 ++++--
|
||||||
|
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/lib/cucumber/formatter/backtrace_filter.rb b/lib/cucumber/formatter/backtrace_filter.rb
|
||||||
|
index d0359e34..d58df52a 100644
|
||||||
|
--- a/lib/cucumber/formatter/backtrace_filter.rb
|
||||||
|
+++ b/lib/cucumber/formatter/backtrace_filter.rb
|
||||||
|
@@ -13,15 +13,17 @@ module Cucumber
|
||||||
|
minitest
|
||||||
|
test/unit
|
||||||
|
.gem/ruby
|
||||||
|
- lib/ruby/
|
||||||
|
bin/bundle
|
||||||
|
)
|
||||||
|
+
|
||||||
|
+ @backtrace_filters << RbConfig::CONFIG['rubyarchdir']
|
||||||
|
+ @backtrace_filters << RbConfig::CONFIG['rubylibdir']
|
||||||
|
|
||||||
|
if ::Cucumber::JRUBY
|
||||||
|
@backtrace_filters << 'org/jruby/'
|
||||||
|
end
|
||||||
|
|
||||||
|
- BACKTRACE_FILTER_PATTERNS = Regexp.new(@backtrace_filters.join('|'))
|
||||||
|
+ BACKTRACE_FILTER_PATTERNS = Regexp.new(@backtrace_filters.compact.join('|'))
|
||||||
|
|
||||||
|
class BacktraceFilter
|
||||||
|
def initialize(exception)
|
||||||
|
--
|
||||||
|
2.20.1
|
||||||
|
|
Loading…
Reference in new issue