From 444fba548c7417c197cd3bdbfcffd85631fd6e3c Mon Sep 17 00:00:00 2001 From: cherry530 Date: Fri, 3 Dec 2021 15:29:43 +0800 Subject: [PATCH] fix tests failed Signed-off-by: cherry530 --- Fix-failing-tests.patch | 25 +++++++++++++++++++++++++ rubygem-sinatra.spec | 7 ++++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 Fix-failing-tests.patch diff --git a/Fix-failing-tests.patch b/Fix-failing-tests.patch new file mode 100644 index 0000000..e844a38 --- /dev/null +++ b/Fix-failing-tests.patch @@ -0,0 +1,25 @@ +From 750aa3b0de06dad41539bdb402123b5416a3475d Mon Sep 17 00:00:00 2001 +From: Jordan Owens +Date: Tue, 10 Mar 2020 10:24:05 -0400 +Subject: [PATCH] Fix failing tests + +Rack added support for Multi-part ranges and apparently changed the +format of cookie expires timestamp format to match specs. +--- + test/static_test.rb | 3 +-- + 1 files changed, 1 insertions(+), 2 deletions(-) + +diff --git a/test/static_test.rb b/test/static_test.rb +index e8408b14e..1c6cb35e9 100644 +--- a/test/static_test.rb ++++ b/test/static_test.rb +@@ -152,8 +152,7 @@ def assert_valid_range(http_range, range, path, file) + end + + it 'correctly ignores syntactically invalid range requests' do +- # ...and also ignores multi-range requests, which aren't supported yet +- ["bytes=45-40", "bytes=IV-LXVI", "octets=10-20", "bytes=-", "bytes=1-2,3-4"].each do |http_range| ++ ["bytes=45-40", "bytes=IV-LXVI", "octets=10-20", "bytes=", "bytes=3-1,4-5"].each do |http_range| + request = Rack::MockRequest.new(@app) + response = request.get("/#{File.basename(__FILE__)}", 'HTTP_RANGE' => http_range) + diff --git a/rubygem-sinatra.spec b/rubygem-sinatra.spec index f2f37de..1ae1241 100644 --- a/rubygem-sinatra.spec +++ b/rubygem-sinatra.spec @@ -3,11 +3,12 @@ Summary: Ruby-based web application framework Name: rubygem-%{gem_name} Version: 2.0.3 -Release: 1 +Release: 2 License: MIT URL: http://www.sinatrarb.com/ Source0: https://rubygems.org/gems/sinatra-%{version}.gem Source1: https://github.com/sinatra/sinatra/archive/v%{version}.tar.gz +Patch0: Fix-failing-tests.patch BuildRequires: rubygems-devel %if ! 0%{?bootstrap} BuildRequires: rubygem(rack) >= 2.0 rubygem(rack-protection) = %{version} rubygem(tilt) @@ -47,6 +48,7 @@ sed -i -e 's|^#!/usr/bin/env ruby|#!/usr/bin/ruby|' \ pushd .%{gem_instdir} tar xzvf %{SOURCE1} cd %{gem_name}-%{version} +cat %{PATCH0} | patch -p1 for FILE in $(grep -rl '^require.*bundler.*' test/); do sed -i "/^require 'bundler.*'/ s/^/#/" ${FILE} done @@ -78,5 +80,8 @@ popd %{gem_instdir}/examples %changelog +* Fri Dec 03 2021 xu_ping - 2.0.3-2 +- Fix tests failed + * Sat Aug 22 2020 liyanan - 2.0.3-1 - package init