27 lines
1.1 KiB
Diff
27 lines
1.1 KiB
Diff
From c5151907f29a101912b1f419aff25a1db02c7978 Mon Sep 17 00:00:00 2001
|
|
From: Thomas Walpole <twalpole@gmail.com>
|
|
Date: Fri, 28 May 2021 17:38:46 -0700
|
|
Subject: [PATCH 1/2] Use Psych safe load in tests
|
|
|
|
---
|
|
lib/capybara/spec/spec_helper.rb | 5 +++--
|
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/lib/capybara/spec/spec_helper.rb b/lib/capybara/spec/spec_helper.rb
|
|
index 7a3eb2ea49..c471afc26a 100644
|
|
--- a/lib/capybara/spec/spec_helper.rb
|
|
+++ b/lib/capybara/spec/spec_helper.rb
|
|
@@ -117,8 +117,9 @@ def quietly(&block)
|
|
|
|
def extract_results(session)
|
|
expect(session).to have_xpath("//pre[@id='results']")
|
|
- # YAML.load Nokogiri::HTML(session.body).xpath("//pre[@id='results']").first.inner_html.lstrip
|
|
- YAML.load Capybara::HTML(session.body).xpath("//pre[@id='results']").first.inner_html.lstrip
|
|
+ perms = [(::Sinatra::IndifferentHash if defined? ::Sinatra::IndifferentHash)].compact
|
|
+ results = Capybara::HTML(session.body).xpath("//pre[@id='results']").first.inner_html.lstrip
|
|
+ YAML.safe_load results, permitted_classes: perms
|
|
end
|
|
|
|
def be_an_invalid_element_error(session)
|
|
|