6f58083
# Generated from shoulda-matchers-2.6.1.gem by gem2rpm -*- rpm-spec -*-
6f58083
%global gem_name shoulda-matchers
6f58083
6f58083
Name: rubygem-%{gem_name}
8011a2c
Version: 4.5.1
54bd827
Release: 3%{?dist}
758eabc
Summary: Simple one-liner tests for common Rails functionality
6f58083
License: MIT
758eabc
URL: https://matchers.shoulda.io/
6f58083
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
758eabc
# git clone https://github.com/thoughtbot/shoulda-matchers.git && cd shoulda-matchers
8011a2c
# git archive -v -o shoulda-matchers-4.5.1-specs.tar.gz v4.5.1 spec/
8011a2c
Source1: shoulda-matchers-4.5.1-specs.tar.gz
8011a2c
# Fix bootsnap removal which is not enclosed in quotes.
8011a2c
# https://github.com/thoughtbot/shoulda-matchers/pull/1410
8011a2c
Patch0: rubygem-shoulda-matchers-4.5.1-Remove-rack-mini-profiler-dependency.patch
8011a2c
Patch1: rubygem-shoulda-matchers-4.1.2-Accept-double-quotes-when-removing-bootsnap.patch
8011a2c
Patch2: rubygem-shoulda-matchers-4.5.1-Fix-keyword-arguments-for-Ruby-3.0-compatibility.patch
8011a2c
Patch3: rubygem-shoulda-matchers-4.5.1-Disable-test-failing-due-to-changes-in-Rails-6.1.patch
8011a2c
Patch4: rubygem-shoulda-matchers-4.5.1-Disable-CPK-test-cases-due-to-Rails-6.1-compatibilit.patch
8011a2c
# Fix kwargs for Ruby 3.
8011a2c
# https://github.com/thoughtbot/shoulda-matchers/pull/1406
8011a2c
Patch5: rubygem-shoulda-matchers-4.5.1-Handle-argument-delegation-for-Ruby-3.patch
758eabc
6f58083
BuildRequires: ruby(release)
6f58083
BuildRequires: rubygems-devel
664648c
BuildRequires: ruby
6f58083
BuildRequires: rubygem(bcrypt)
6f58083
BuildRequires: rubygem(jbuilder)
6f58083
BuildRequires: rubygem(rails)
68a0bb3
BuildRequires: rubygem(rails-controller-testing)
68a0bb3
BuildRequires: rubygem(rspec)
6f58083
BuildRequires: rubygem(rspec-rails)
664648c
BuildRequires: rubygem(shoulda-context)
6f58083
BuildRequires: rubygem(spring)
6f58083
BuildRequires: rubygem(sqlite3)
6f58083
BuildArch: noarch
6f58083
6f58083
%description
758eabc
Shoulda Matchers provides RSpec- and Minitest-compatible one-liners to test
758eabc
common Rails functionality that, if written by hand, would be much longer,
6f58083
more complex, and error-prone.
6f58083
6f58083
6f58083
%package doc
6f58083
Summary: Documentation for %{name}
6f58083
Requires: %{name} = %{version}-%{release}
6f58083
BuildArch: noarch
6f58083
6f58083
%description doc
6f58083
Documentation for %{name}.
6f58083
6f58083
%prep
758eabc
%setup -q -n %{gem_name}-%{version} -b 1
6f58083
8011a2c
%patch5 -p1
8011a2c
ca1d10b
pushd %{_builddir}
ca1d10b
%patch0 -p1
8011a2c
%patch1 -p1
8011a2c
%patch2 -p1
8011a2c
%patch3 -p1
8011a2c
%patch4 -p1
ca1d10b
popd
ca1d10b
6f58083
%build
6f58083
# Create the gem as gem install only works on a gem file
68a0bb3
gem build ../%{gem_name}-%{version}.gemspec
6f58083
6f58083
# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
6f58083
# by default, so that we can move it into the buildroot in %%install
6f58083
%gem_install
6f58083
6f58083
%install
6f58083
mkdir -p %{buildroot}%{gem_dir}
6f58083
cp -a .%{gem_dir}/* \
6f58083
        %{buildroot}%{gem_dir}/
6f58083
68a0bb3
6f58083
6f58083
%check
6f58083
pushd .%{gem_instdir}
758eabc
ln -s %{_builddir}/spec spec
6f58083
0ad1b18
# It is easier to recreate the Gemfile to use local versions of gems.
0ad1b18
cat << GF > Gemfile
0ad1b18
source 'https://rubygems.org'
0ad1b18
8011a2c
gem 'actiontext'
0ad1b18
gem 'bcrypt'
0ad1b18
gem 'rails'
68a0bb3
gem 'rails-controller-testing'
68a0bb3
gem 'rspec'
68a0bb3
gem 'rspec-rails'
0ad1b18
gem 'sqlite3'
68a0bb3
gem 'spring'
0ad1b18
GF
0ad1b18
68a0bb3
# Pry is useless for our purposes.
68a0bb3
sed -i "/require 'pry/ s/^/#/" spec/spec_helper.rb
0ad1b18
68a0bb3
# Avoid Appraisal and Bundler.
8011a2c
sed -i "/current_bundle/ s/^/#/" \
8011a2c
  spec/acceptance_spec_helper.rb \
8011a2c
  spec/support/unit/load_environment.rb
8011a2c
sed -i "/CurrentBundle/ s/^/#/" \
8011a2c
  spec/acceptance_spec_helper.rb \
8011a2c
  spec/support/unit/load_environment.rb
0ad1b18
68a0bb3
# Avoid bootsnap, listen, puma and sprockets dependencies.
758eabc
sed -i "/def rails_new_command/,/^    end$/ {
758eabc
  /\]/i\          '--skip-listen',
758eabc
}" spec/support/unit/rails_application.rb
8011a2c
sed -i '/rails new/ s/"$/ --skip-bootsnap --skip-listen --skip-puma --skip-sprockets"/' \
3b0b4c3
  spec/support/acceptance/helpers/step_helpers.rb
68a0bb3
758eabc
bundle exec rspec spec/unit
758eabc
68a0bb3
# Don't test against PostgreSQL, it would just complicate everything.
68a0bb3
sed -i "/bundle.add_gem 'pg'/ s/^/#/" spec/support/acceptance/helpers/step_helpers.rb
68a0bb3
# spring-commands-rspec is not in Fedora yet, but the test suite looks to pass
68a0bb3
# without it just fine.
68a0bb3
sed -i "/add_gem 'spring-commands-rspec'/ s/^/#/" spec/support/acceptance/helpers/step_helpers.rb
8011a2c
# Remove excesive test dependencies.
68a0bb3
sed -i "/updating_bundle do |bundle|/a \\
68a0bb3
        bundle.remove_gem 'capybara'" spec/support/acceptance/helpers/step_helpers.rb
68a0bb3
sed -i "/updating_bundle do |bundle|/a \\
68a0bb3
        bundle.remove_gem 'selenium-webdriver'" spec/support/acceptance/helpers/step_helpers.rb
68a0bb3
sed -i "/updating_bundle do |bundle|/a \\
3b0b4c3
        bundle.remove_gem 'webdrivers'" spec/support/acceptance/helpers/step_helpers.rb
6f58083
8011a2c
# There are some issue with Spring. The test suite often hangs with symptoms
8011a2c
# similar to https://github.com/rails/spring/issues/265. Use DISABLE_SPRING
8011a2c
# to bypass Spring temporary.
8011a2c
DISABLE_SPRING=true bundle exec rspec spec/acceptance
6f58083
6f58083
popd
6f58083
6f58083
%files
6f58083
%dir %{gem_instdir}
8011a2c
%license %{gem_instdir}/LICENSE
6f58083
%{gem_libdir}
6f58083
%exclude %{gem_cache}
6f58083
%{gem_spec}
6f58083
6f58083
%files doc
6f58083
%doc %{gem_docdir}
6f58083
%doc %{gem_instdir}/README.md
68a0bb3
%doc %{gem_instdir}/docs
6f58083
%{gem_instdir}/shoulda-matchers.gemspec
6f58083
6f58083
%changelog
54bd827
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 4.5.1-3
54bd827
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
54bd827
91f7e4f
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.5.1-2
91f7e4f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
91f7e4f
8011a2c
* Tue Feb 09 2021 Vít Ondruch <vondruch@redhat.com> - 4.5.1-1
8011a2c
- Update to should-matchers 4.5.1.
8011a2c
  Resolves: rhbz#1789238
8011a2c
  Resolves: rhbz#1923698
8011a2c
58ddd5f
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.2-6
58ddd5f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
58ddd5f
ca1d10b
* Fri Nov 27 2020 Vít Ondruch <vondruch@redhat.com> - 4.1.2-5
ca1d10b
- Fix RSpec 3.9+ compatibility.
ca1d10b
  Resolves: rhbz#1800038
ca1d10b
  Resolves: rhbz#1863734
3b0b4c3
- Fix Rails 6.0+ compatibility.
ca1d10b
f011c7e
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.2-5
f011c7e
- Second attempt - Rebuilt for
f011c7e
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
f011c7e
8f0ae84
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.2-4
8f0ae84
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
8f0ae84
2c6047a
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.2-3
2c6047a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
2c6047a
460f43a
* Mon Nov 11 2019 Vít Ondruch <vondruch@redhat.com> - 4.1.2-2
460f43a
- Remove unnecessary BR: rubygem(minitest-reporters).
460f43a
758eabc
* Thu Nov 07 2019 Vít Ondruch <vondruch@redhat.com> - 4.1.2-1
758eabc
- Update to should-matchers 4.1.2.
758eabc
0232b91
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.2-3
0232b91
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
0232b91
74d2edb
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.2-2
74d2edb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
74d2edb
68a0bb3
* Sat Aug 11 2018 Vít Ondruch <vondruch@redhat.com> - 3.1.2-1
68a0bb3
- Update to should-matchers 3.1.2.
68a0bb3
524b2c4
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.8.0-6
524b2c4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
524b2c4
42c491b
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.8.0-5
42c491b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
42c491b
b6d2a9f
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.8.0-4
b6d2a9f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
b6d2a9f
29a4cfa
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.8.0-3
29a4cfa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
29a4cfa
0ef53c1
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.8.0-2
0ef53c1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
0ef53c1
0ad1b18
* Fri Jun 26 2015 Vít Ondruch <vondruch@redhat.com> - 2.8.0-1
0ad1b18
- Update to should-matchers 2.8.0.
0ad1b18
3791b65
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6.1-4
3791b65
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
3791b65
6bc8713
* Mon Jul 07 2014 Vít Ondruch <vondruch@redhat.com> - 2.6.1-3
6bc8713
- Workaround RoR 4.1.2+ compatibility issue.
fb298fc
- Relax Rake dependency.
6bc8713
664648c
* Thu Jul 03 2014 Vít Ondruch <vondruch@redhat.com> - 2.6.1-2
664648c
- Add missing BR: rubygem(shoulda-context).
664648c
- Updated upstream URL.
664648c
- Relaxed BR: ruby dependency.
664648c
6f58083
* Mon Jun 30 2014 Vít Ondruch <vondruch@redhat.com> - 2.6.1-1
6f58083
- Initial package