Add bcond_with for tests

as it has circular dependency with activesupport.
Also fixup the build, adding activesupport to BRs.
f38
Pavel Valena 5 years ago
parent b1233e76cf
commit 1b5e148a63

@ -1,5 +1,7 @@
%global gem_name i18n %global gem_name i18n
%bcond_without tests
Name: rubygem-%{gem_name} Name: rubygem-%{gem_name}
Version: 1.7.0 Version: 1.7.0
Release: 1%{?dist} Release: 1%{?dist}
@ -15,10 +17,13 @@ Source1: %{gem_name}-%{version}-tests.txz
BuildRequires: ruby BuildRequires: ruby
BuildRequires: ruby(release) BuildRequires: ruby(release)
BuildRequires: rubygems-devel BuildRequires: rubygems-devel
%if %{with tests}
BuildRequires: rubygem(minitest) BuildRequires: rubygem(minitest)
BuildRequires: rubygem(mocha) BuildRequires: rubygem(mocha)
BuildRequires: rubygem(test_declarative) BuildRequires: rubygem(test_declarative)
BuildRequires: rubygem(concurrent-ruby) BuildRequires: rubygem(concurrent-ruby)
BuildRequires: rubygem(activesupport)
%endif
BuildArch: noarch BuildArch: noarch
%description %description
@ -45,6 +50,7 @@ mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \ cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/ %{buildroot}%{gem_dir}/
%if %{with tests}
%check %check
pushd .%{gem_instdir} pushd .%{gem_instdir}
ln -s %{_builddir}/test . ln -s %{_builddir}/test .
@ -56,6 +62,7 @@ sed -i -e "/require 'bundler\/setup'/ s/^/#/" test/test_helper.rb
# https://github.com/svenfuchs/i18n/issues/115 # https://github.com/svenfuchs/i18n/issues/115
LANG=C.utf8 ruby -Ilib:test -e 'Dir.glob "./test/**/*_test.rb", &method(:require)' LANG=C.utf8 ruby -Ilib:test -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
popd popd
%endif
%files %files
%dir %{gem_instdir} %dir %{gem_instdir}
@ -67,8 +74,6 @@ popd
%files doc %files doc
%doc %{gem_docdir} %doc %{gem_docdir}
%doc %{gem_instdir}/README.md %doc %{gem_instdir}/README.md
%{gem_instdir}/gemfiles
%{gem_instdir}/test
%changelog %changelog
* Wed Oct 16 2019 Pavel Valena <pvalena@redhat.com> - 1.7.0-1 * Wed Oct 16 2019 Pavel Valena <pvalena@redhat.com> - 1.7.0-1

Loading…
Cancel
Save