ignore bundler/inline from callers

Fixes #1507
This commit is contained in:
Kunpei Sakai 2019-02-04 01:06:35 +09:00
parent cb4f651282
commit 932665fe15
No known key found for this signature in database
GPG Key ID: C4B6919318C291BC
2 changed files with 7 additions and 1 deletions

View File

@ -1168,7 +1168,7 @@ module Sinatra
/^\(.*\)$/, # generated code
/rubygems\/(custom|core_ext\/kernel)_require\.rb$/, # rubygems require hacks
/active_support/, # active_support require hacks
/bundler(\/runtime)?\.rb/, # bundler require hacks
/bundler(\/(?:runtime|inline))?\.rb/, # bundler require hacks
/<internal:/, # internal in ruby >= 1.9.2
/src\/kernel\/bootstrap\/[A-Z]/ # maglev kernel files
]

View File

@ -186,6 +186,12 @@ class SettingsTest < Minitest::Test
@base.enable :methodoverride
assert @base.methodoverride?
end
it 'ignores bundler/inline from callers' do
@application.stub(:caller, ->(_){ ['/path/to/bundler/inline.rb', $0] }) do
assert_equal File.expand_path($0), File.expand_path(@application.send(:caller_files).first)
end
end
end
describe 'run' do