!4 [sync] PR-3: solve test error due to rubygem-rack update to 2.2.0+

From: @openeuler-sync-bot
Reviewed-by: @hht8
Signed-off-by: @hht8
This commit is contained in:
openeuler-ci-bot 2021-02-25 11:34:25 +08:00 committed by Gitee
commit 417444712f

View File

@ -3,7 +3,7 @@
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
@ -51,6 +51,10 @@ for FILE in $(grep -rl '^require.*bundler.*' test/); do
sed -i "/^require 'bundler.*'/ s/^/#/" ${FILE}
done
mv test/integration_test.rb{,.disabled}
#solve test error due to rubygem-rack 2.2.0+ changes
sed -i '160,162d' test/static_test.rb
sed -i '159a\assert(' test/static_test.rb
sed -i '160a\response.status == 200 || response.status == 206,' test/static_test.rb
ruby -e 'Dir.glob "./test/*_test.rb", &method(:require)'
popd
%endif
@ -78,5 +82,8 @@ popd
%{gem_instdir}/examples
%changelog
* Wed Feb 10 2021 Ge Wang <wangge20@huawei.com> - 2.0.3-2
- solve test error due to rubygem-rack update to 2.2.0+
* Sat Aug 22 2020 liyanan <liyanan32@huawei.com> - 2.0.3-1
- package init