fix tests failed
Signed-off-by: cherry530 <xuping33@huawei.com>
This commit is contained in:
parent
3264f3a896
commit
444fba548c
25
Fix-failing-tests.patch
Normal file
25
Fix-failing-tests.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
From 750aa3b0de06dad41539bdb402123b5416a3475d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jordan Owens <jkowens@gmail.com>
|
||||||
|
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)
|
||||||
|
|
||||||
@ -3,11 +3,12 @@
|
|||||||
Summary: Ruby-based web application framework
|
Summary: Ruby-based web application framework
|
||||||
Name: rubygem-%{gem_name}
|
Name: rubygem-%{gem_name}
|
||||||
Version: 2.0.3
|
Version: 2.0.3
|
||||||
Release: 1
|
Release: 2
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: http://www.sinatrarb.com/
|
URL: http://www.sinatrarb.com/
|
||||||
Source0: https://rubygems.org/gems/sinatra-%{version}.gem
|
Source0: https://rubygems.org/gems/sinatra-%{version}.gem
|
||||||
Source1: https://github.com/sinatra/sinatra/archive/v%{version}.tar.gz
|
Source1: https://github.com/sinatra/sinatra/archive/v%{version}.tar.gz
|
||||||
|
Patch0: Fix-failing-tests.patch
|
||||||
BuildRequires: rubygems-devel
|
BuildRequires: rubygems-devel
|
||||||
%if ! 0%{?bootstrap}
|
%if ! 0%{?bootstrap}
|
||||||
BuildRequires: rubygem(rack) >= 2.0 rubygem(rack-protection) = %{version} rubygem(tilt)
|
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}
|
pushd .%{gem_instdir}
|
||||||
tar xzvf %{SOURCE1}
|
tar xzvf %{SOURCE1}
|
||||||
cd %{gem_name}-%{version}
|
cd %{gem_name}-%{version}
|
||||||
|
cat %{PATCH0} | patch -p1
|
||||||
for FILE in $(grep -rl '^require.*bundler.*' test/); do
|
for FILE in $(grep -rl '^require.*bundler.*' test/); do
|
||||||
sed -i "/^require 'bundler.*'/ s/^/#/" ${FILE}
|
sed -i "/^require 'bundler.*'/ s/^/#/" ${FILE}
|
||||||
done
|
done
|
||||||
@ -78,5 +80,8 @@ popd
|
|||||||
%{gem_instdir}/examples
|
%{gem_instdir}/examples
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Dec 03 2021 xu_ping <xuping33@huawei.com> - 2.0.3-2
|
||||||
|
- Fix tests failed
|
||||||
|
|
||||||
* Sat Aug 22 2020 liyanan <liyanan32@huawei.com> - 2.0.3-1
|
* Sat Aug 22 2020 liyanan <liyanan32@huawei.com> - 2.0.3-1
|
||||||
- package init
|
- package init
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user