Fix build error
(cherry picked from commit ad5719ad3085ff10af8fd609300dc2597523c327)
This commit is contained in:
parent
50e0cfd494
commit
78c946ae92
36
rubygem-mustache-1.0.2-Fix-test-race-condition.patch
Normal file
36
rubygem-mustache-1.0.2-Fix-test-race-condition.patch
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
From 407c6a5db6c1f1cfb40bd6113f07f067d07885a4 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
|
||||||
|
Date: Mon, 27 Apr 2020 11:16:17 +0200
|
||||||
|
Subject: [PATCH] Fix test race condition.
|
||||||
|
|
||||||
|
The test suite randomly fails with errors such as:
|
||||||
|
|
||||||
|
~~~
|
||||||
|
1) Failure:
|
||||||
|
AutoloadingTest#test_autoload_lowercase [/builddir/build/BUILD/mustache-1.1.1/usr/share/gems/gems/mustache-1.1.1/test/autoloading_test.rb:17]:
|
||||||
|
Expected: Comments
|
||||||
|
Actual: nil
|
||||||
|
~~~
|
||||||
|
|
||||||
|
This happens when `test_namespaced*` test cases are executed earlier
|
||||||
|
than the remaining test cases, because they are defining
|
||||||
|
`view_namespace` but not cleaning up afterwards.
|
||||||
|
---
|
||||||
|
test/autoloading_test.rb | 4 ++++
|
||||||
|
1 file changed, 4 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/usr/share/gems/gems/mustache-1.0.2/test/autoloading_test.rb a/usr/share/gems/gems/mustache-1.0.2/test/autoloading_test.rb
|
||||||
|
index 0a7ad762..77eb3557 100644
|
||||||
|
--- a/usr/share/gems/gems/mustache-1.0.2/test/autoloading_test.rb
|
||||||
|
+++ b/usr/share/gems/gems/mustache-1.0.2/test/autoloading_test.rb
|
||||||
|
@@ -7,6 +7,10 @@ def setup
|
||||||
|
Mustache.view_path = File.dirname(__FILE__) + '/fixtures'
|
||||||
|
end
|
||||||
|
|
||||||
|
+ def teardown
|
||||||
|
+ Mustache.remove_instance_variable(:@view_namespace) if Mustache.instance_variable_defined?(:@view_namespace)
|
||||||
|
+ end
|
||||||
|
+
|
||||||
|
def test_autoload
|
||||||
|
klass = Mustache.view_class(:Comments)
|
||||||
|
assert_equal Comments, klass
|
||||||
@ -2,11 +2,12 @@
|
|||||||
|
|
||||||
Name: rubygem-mustache
|
Name: rubygem-mustache
|
||||||
Version: 1.0.2
|
Version: 1.0.2
|
||||||
Release: 7
|
Release: 8
|
||||||
Summary: A framework-agnostic way to render logic-free views
|
Summary: A framework-agnostic way to render logic-free views
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://github.com/mustache/mustache
|
URL: https://github.com/mustache/mustache
|
||||||
Source0: https://rubygems.org/gems/mustache-%{version}.gem
|
Source0: https://rubygems.org/gems/mustache-%{version}.gem
|
||||||
|
Patch0: rubygem-mustache-1.0.2-Fix-test-race-condition.patch
|
||||||
BuildRequires: ruby(release) rubygems-devel ruby rubygem(minitest)
|
BuildRequires: ruby(release) rubygems-devel ruby rubygem(minitest)
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
@ -28,6 +29,7 @@ Documentation for rubygem-mustache.
|
|||||||
%prep
|
%prep
|
||||||
%setup -q -c -T
|
%setup -q -c -T
|
||||||
%gem_install -n %{SOURCE0}
|
%gem_install -n %{SOURCE0}
|
||||||
|
%patch0 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
|
||||||
@ -68,5 +70,8 @@ cd -
|
|||||||
%{gem_instdir}/{Rakefile,test}
|
%{gem_instdir}/{Rakefile,test}
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sat Jan 22 2022 liyanan <liyanan32@huawei.com> - 1.0.2-8
|
||||||
|
- Fix build error
|
||||||
|
|
||||||
* Sat Mar 14 2020 Ling Yang <lingyang2@huawei.com> - 1.0.2-7
|
* Sat Mar 14 2020 Ling Yang <lingyang2@huawei.com> - 1.0.2-7
|
||||||
- Package Init
|
- Package Init
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user