From 60aa3d265e7bf4975810ba438754fcb33ed77f97 Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Tue, 26 Dec 2017 20:14:20 +0100 Subject: testing/ruby-escape_utils: fix tests on Ruby 2.5 --- testing/ruby-escape_utils/APKBUILD | 6 +++-- .../ruby-escape_utils/fix-tests-for-ruby-2.5.patch | 27 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 testing/ruby-escape_utils/fix-tests-for-ruby-2.5.patch (limited to 'testing/ruby-escape_utils') diff --git a/testing/ruby-escape_utils/APKBUILD b/testing/ruby-escape_utils/APKBUILD index 56e4354365..ff7a8ec7f7 100644 --- a/testing/ruby-escape_utils/APKBUILD +++ b/testing/ruby-escape_utils/APKBUILD @@ -12,7 +12,8 @@ license="MIT" checkdepends="ruby ruby-bundler ruby-minitest ruby-rake-compiler" makedepends="ruby-dev" source="$pkgname-$pkgver.tar.gz::https://github.com/brianmario/escape_utils/archive/$pkgver.tar.gz - gemspec.patch" + gemspec.patch + fix-tests-for-ruby-2.5.patch" builddir="$srcdir/$_gemname-$pkgver" build() { @@ -44,4 +45,5 @@ package() { } sha512sums="c2af40a2a3c0cc083a55771e2ed813992391c833b6d64cb9255ec5741c2da6980ddf34331256b73f18617cf8df6b745e81bdd6c1632d63936ccd3a655758b083 ruby-escape_utils-1.2.1.tar.gz -8cb3c26b46304899b2d200208c18650ab28da81ea42d8479a89b06802d252757df537c997fe5f640122a4521016f0676c267c691bc6be33ce066fe4be0c504d5 gemspec.patch" +8cb3c26b46304899b2d200208c18650ab28da81ea42d8479a89b06802d252757df537c997fe5f640122a4521016f0676c267c691bc6be33ce066fe4be0c504d5 gemspec.patch +06de5f7afcc3b7461d9e915d62ae0405d2161c37759c6868c9b550998995935b90e2865d30b1c9c9a0a5a474d96c5f94762114cda7b2c0b825717c8066115b62 fix-tests-for-ruby-2.5.patch" diff --git a/testing/ruby-escape_utils/fix-tests-for-ruby-2.5.patch b/testing/ruby-escape_utils/fix-tests-for-ruby-2.5.patch new file mode 100644 index 0000000000..0579a99ab6 --- /dev/null +++ b/testing/ruby-escape_utils/fix-tests-for-ruby-2.5.patch @@ -0,0 +1,27 @@ +CGI.escape does not escape "~" since Ruby 2.5. + +--- a/test/uri_component/escape_test.rb ++++ b/test/uri_component/escape_test.rb +@@ -10,8 +10,9 @@ + (0..127).each do |i| + c = i.chr + # Escaping URI path components should match CGI parameter escaping, except +- # spaces should be escaped as "%20" instead of "+" +- assert_equal CGI.escape(c).sub("+", "%20"), EscapeUtils.escape_uri_component(c) ++ # spaces should be escaped as "%20" instead of "+" and "~" should be ++ # escaped as "%7E". ++ assert_equal CGI.escape(c).sub("+", "%20").sub("~", "%7E"), EscapeUtils.escape_uri_component(c) + end + end + +--- a/test/url/escape_test.rb ++++ b/test/url/escape_test.rb +@@ -9,7 +9,7 @@ + def test_cgi_stdlib_compatibility + (0..127).each do |i| + c = i.chr +- assert_equal CGI.escape(c), EscapeUtils.escape_url(c) ++ assert_equal CGI.escape(c).sub("~", "%7E"), EscapeUtils.escape_url(c) + end + end + -- cgit v1.2.3