From 4f2727b96d898bfa21300485fff9247b257d15ca Mon Sep 17 00:00:00 2001 From: Adam Bouhenguel Date: Fri, 22 Jul 2016 14:24:49 -0700 Subject: [PATCH] Be careful about Pathnames in $LOAD_PATH --- src/qa/runner-assets/ruby/shared.rb | 2 +- src/qa_test/fixtures/ruby/all-outcomes/spec/error_spec.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/qa/runner-assets/ruby/shared.rb b/src/qa/runner-assets/ruby/shared.rb index 568a152..9cdefb6 100644 --- a/src/qa/runner-assets/ruby/shared.rb +++ b/src/qa/runner-assets/ruby/shared.rb @@ -752,7 +752,7 @@ def summarize_exception(error, backtrace, message=nil) # ] backtrace_bindings = error.instance_variable_get(:@__qa_caller_bindings) - load_path = $LOAD_PATH + load_path = $LOAD_PATH.map(&:to_s) backtrace = backtrace.each_with_index.map do |entry, index| entry =~ /(.+?):(\d+)(?:\:in `(.*)')?/ || (next nil) diff --git a/src/qa_test/fixtures/ruby/all-outcomes/spec/error_spec.rb b/src/qa_test/fixtures/ruby/all-outcomes/spec/error_spec.rb index d4fc0ba..7d27369 100644 --- a/src/qa_test/fixtures/ruby/all-outcomes/spec/error_spec.rb +++ b/src/qa_test/fixtures/ruby/all-outcomes/spec/error_spec.rb @@ -1,3 +1,8 @@ +# Try to pollute LOAD_PATH. +require 'pathname' + +$LOAD_PATH.push(Pathname.new("foo")) + RSpec.describe "Error" do context "world of errors" do it "always errors" do