Fix test suite compatibility with minitest 5

f38
Josef Stribny 11 years ago
parent 09c83cc914
commit 39793c7c35

@ -3,13 +3,14 @@
Summary: New wave Internationalization support for Ruby Summary: New wave Internationalization support for Ruby
Name: rubygem-%{gem_name} Name: rubygem-%{gem_name}
Version: 0.6.9 Version: 0.6.9
Release: 3%{?dist} Release: 4%{?dist}
Group: Development/Languages Group: Development/Languages
License: MIT and (BSD or Ruby) License: MIT and (BSD or Ruby)
URL: http://github.com/svenfuchs/i18n URL: http://github.com/svenfuchs/i18n
Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem
Requires: ruby(rubygems) # Upstream fix for Minitest 5
Requires: ruby(release) # https://github.com/svenfuchs/i18n/commit/c6d95dafa30253c992047e699b26377669979af0
Patch0: rubygem-i18n-0.6.10-minitest5.patch
BuildRequires: ruby(release) BuildRequires: ruby(release)
BuildRequires: rubygems-devel BuildRequires: rubygems-devel
BuildRequires: rubygem(minitest) BuildRequires: rubygem(minitest)
@ -33,10 +34,14 @@ Requires:%{name} = %{version}-%{release}
Documentation for %{name} Documentation for %{name}
%prep %prep
%setup -q -c -T gem unpack %{SOURCE0}
%gem_install -n %{SOURCE0} %setup -q -D -T -n %{gem_name}-%{version}
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
%patch0 -p1
%build %build
gem build %{gem_name}.gemspec
%gem_install
%install %install
mkdir -p %{buildroot}%{gem_dir} mkdir -p %{buildroot}%{gem_dir}
@ -50,9 +55,11 @@ pushd .%{gem_instdir}
# Bundler just complicates everything in our case, remove it. # Bundler just complicates everything in our case, remove it.
sed -i -e "s|require 'bundler/setup'||" test/test_helper.rb sed -i -e "s|require 'bundler/setup'||" test/test_helper.rb
# Fix all files to use I18n::TestCase from the patch
find ./test -name '*_test.rb' | xargs sed -i -e 's/Test::Unit::TestCase/I18n::TestCase/'
# Tests are failing without LANG environment is set. # Tests are failing without LANG environment is set.
# https://github.com/svenfuchs/i18n/issues/115 # https://github.com/svenfuchs/i18n/issues/115
LANG=en_US.utf8 testrb -Ilib test/all.rb LANG=en_US.utf8 ruby -Ilib:test test/all.rb
popd popd
%files %files
@ -70,6 +77,9 @@ popd
%changelog %changelog
* Wed Jun 18 2014 Josef Stribny <jstribny@redhat.com> - 0.6.9-4
- Fix test suite compatibility with minitest 5
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.9-3 * Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.9-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

Loading…
Cancel
Save