Skip to content

Commit 4f2727b

Browse files
committedJul 22, 2016
Be careful about Pathnames in $LOAD_PATH
1 parent ca38e09 commit 4f2727b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
 

‎src/qa/runner-assets/ruby/shared.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ def summarize_exception(error, backtrace, message=nil)
752752
# ]
753753

754754
backtrace_bindings = error.instance_variable_get(:@__qa_caller_bindings)
755-
load_path = $LOAD_PATH
755+
load_path = $LOAD_PATH.map(&:to_s)
756756

757757
backtrace = backtrace.each_with_index.map do |entry, index|
758758
entry =~ /(.+?):(\d+)(?:\:in `(.*)')?/ || (next nil)

‎src/qa_test/fixtures/ruby/all-outcomes/spec/error_spec.rb

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Try to pollute LOAD_PATH.
2+
require 'pathname'
3+
4+
$LOAD_PATH.push(Pathname.new("foo"))
5+
16
RSpec.describe "Error" do
27
context "world of errors" do
38
it "always errors" do

0 commit comments

Comments
 (0)
Please sign in to comment.