Filter ruby lib directory from error backtrace
This commit is contained in:
@@ -23,7 +23,8 @@ module Producer
|
||||
end
|
||||
|
||||
describe '#format' do
|
||||
let(:bt) { %W[backtrace /producer-core /net-ssh] }
|
||||
let(:rubylibdir) { RbConfig::CONFIG['rubylibdir'] }
|
||||
let(:bt) { %W[backtrace /producer-core /net-ssh #{rubylibdir}] }
|
||||
|
||||
def exception
|
||||
begin fail 'original exception' rescue fail 'some exception' end
|
||||
@@ -49,6 +50,10 @@ module Producer
|
||||
expect(formatter.format exception).not_to include 'net-ssh'
|
||||
end
|
||||
|
||||
it 'excludes ruby lib directory from the backtrace' do
|
||||
expect(formatter.format exception).not_to include rubylibdir
|
||||
end
|
||||
|
||||
context 'when debug is enabled' do
|
||||
let(:debug) { true }
|
||||
|
||||
|
Reference in New Issue
Block a user