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}
68a0bb3
Version: 3.1.2
74d2edb
Release: 2%{?dist}
6f58083
Summary: Making tests easy on the fingers and eyes
6f58083
License: MIT
664648c
URL: https://github.com/thoughtbot/shoulda-matchers
6f58083
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
68a0bb3
# Fix "undefined method `capture' for module `Kernel'" error.
68a0bb3
# https://github.com/thoughtbot/shoulda-matchers/commit/26522c6b788d96c20027d794178c83f4b6a630b7
68a0bb3
Patch0: rubygem-shoulda-matchers-3.1.2-capture-silence_stream-and-silence_stderr-were-removed-in-Rails-5.patch
68a0bb3
# Fix "undefined method `attr_accessible'" error.
68a0bb3
# https://github.com/thoughtbot/shoulda-matchers/commit/c50af24105399651b1bdbf52bddbb9c72d2b2e19
68a0bb3
Patch1: rubygem-shoulda-matchers-3.1.2-Don-t-protect-attributes-under-Rails-5.patch
68a0bb3
# https://github.com/thoughtbot/shoulda-matchers/commit/45ac5f5d754dae58708f4baef550e4986132d1ec
68a0bb3
Patch2: rubygem-shoulda-matchers-3.1.2-Fix-uniqueness-tests-to-not-use-attr_accessible.patch
68a0bb3
# Fix deprecated Fixnum.
68a0bb3
# https://github.com/thoughtbot/shoulda-matchers/commit/03a1d213805a44a0aec99857e01cab8524aa0c05
68a0bb3
Patch3: rubygem-shoulda-matchers-3.1.2-Deprecation-for-ruby24-removed.patch
68a0bb3
# Fix "undefined method `cast_type'" error.
68a0bb3
# https://github.com/formigarafa/shoulda-matchers/pull/2/commits/df04f8704abc3754c63c488433dac8c30573da6b
68a0bb3
Patch5: rubygem-shoulda-matchers-3.1.2-Fix-Serialize-Matcher-error-undefined-method-cast_type.patch
68a0bb3
# Refactoring of RailsShim used by other patches. It would be hard to backrpot
68a0bb3
# the patches without this one.
68a0bb3
# https://github.com/formigarafa/shoulda-matchers/pull/2/commits/84069646544ce701e6864458378323e1e3361140
68a0bb3
Patch6: rubygem-shoulda-matchers-3.1.2-Refactor-RailsShim.patch
68a0bb3
# Scope request parameters according to Rails version.
68a0bb3
# https://github.com/thoughtbot/shoulda-matchers/commit/ce9624b3c5a08b9134150e228440c771d95782b7
68a0bb3
Patch7: rubygem-shoulda-matchers-3.1.2-Scope-request-parameters-according-to-Rails-version.patch
68a0bb3
# Fix "undefined method `attr_accessible'" errors.
68a0bb3
# https://github.com/thoughtbot/shoulda-matchers/commit/c1a81d4b132a9e6091c42c3ebcd3144fc593c016
68a0bb3
Patch8: rubygem-shoulda-matchers-3.1.2-Disable-allow_mass_assignment_of-tests-under-Rails-5.patch
68a0bb3
# Fix "undefined method `*_filter' for HookController:Class" errors.
68a0bb3
# https://github.com/thoughtbot/shoulda-matchers/commit/6ea9afc1066502fdd5c556fa9edd4ce7085169fc
68a0bb3
Patch9: rubygem-shoulda-matchers-3.1.2-Drop-legacy-callback-matchers-under-Rails-5.patch
68a0bb3
# `render nothing: true` was removed from Rails 5.1 and has no effect anymore.
68a0bb3
# https://github.com/thoughtbot/shoulda-matchers/commit/158839b3a60f0c2a1f243f6e65ec620be55982ee
68a0bb3
Patch10: rubygem-shoulda-matchers-3.1.2-Use-head-instead-of-render-nothing-in-tests.patch
68a0bb3
# Fix "wrong number of arguments (given 1, expected 2)" error.
68a0bb3
# https://github.com/thoughtbot/shoulda-matchers/commit/3dbf2e5646d6b769c6392cdb71003d0f4aee2304
68a0bb3
Patch11: rubygem-shoulda-matchers-3.1.2-Fix-built-in-test-custom-models-with-attrs.patch
68a0bb3
# Fix failing association matcher tests.
68a0bb3
# https://github.com/thoughtbot/shoulda-matchers/commit/5e1e531b8b3fd35a526e73465bd4de64c22a1763
68a0bb3
Patch12: rubygem-shoulda-matchers-3.1.2-Fix-failing-association-matcher-tests.patch
68a0bb3
# Fix validate_inclusion_of tests.
68a0bb3
# https://github.com/thoughtbot/shoulda-matchers/commit/76e63b2638e1fcc84819bdca49d768a635346f5d
68a0bb3
Patch13: rubygem-shoulda-matchers-3.1.2-Fix-validate_inclusion_of-tests.patch
68a0bb3
# Fix migrations in Rails 5.2.
68a0bb3
# https://github.com/thoughtbot/shoulda-matchers/commit/b310986f9a3b7547c98e54db97600f8128e28ff5
68a0bb3
Patch14: rubygem-shoulda-matchers-3.1.2-Use-correct-migration-class-in-acceptance-tests.patch
68a0bb3
# Fix `forwarding to private method` warning.
68a0bb3
# https://github.com/thoughtbot/shoulda-matchers/pull/1038
68a0bb3
Patch15: rubygem-shoulda-matchers-3.1.2-Define-respond_to_missing-on-ObjectDouble.patch
6f58083
BuildRequires: ruby(release)
6f58083
BuildRequires: rubygems-devel
664648c
BuildRequires: ruby
6f58083
BuildRequires: rubygem(activeresource)
6f58083
BuildRequires: rubygem(bcrypt)
6f58083
BuildRequires: rubygem(jbuilder)
68a0bb3
BuildRequires: rubygem(minitest-reporters)
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
6f58083
shoulda-matchers provides Test::Unit- and RSpec-compatible one-liners that
6f58083
test common Rails functionality. These tests would otherwise 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
68a0bb3
%setup -q -n %{gem_name}-%{version}
68a0bb3
68a0bb3
%patch0 -p1
68a0bb3
%patch1 -p1
68a0bb3
%patch2 -p1
68a0bb3
%patch3 -p1
68a0bb3
%patch5 -p1
68a0bb3
%patch6 -p1
68a0bb3
%patch7 -p1
68a0bb3
%gemspec_add_file "spec/support/unit/helpers/action_pack_versions.rb"
68a0bb3
%patch8 -p1
68a0bb3
%patch9 -p1
68a0bb3
%patch10 -p1
68a0bb3
%patch11 -p1
68a0bb3
%patch12 -p1
68a0bb3
%patch13 -p1
68a0bb3
%patch14 -p1
68a0bb3
%gemspec_add_file "spec/support/acceptance/helpers/rails_migration_helpers.rb"
68a0bb3
%patch15 -p1
6f58083
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}
6f58083
0ad1b18
# It is easier to recreate the Gemfile to use local versions of gems.
6f58083
rm Gemfile.lock
0ad1b18
cat << GF > Gemfile
0ad1b18
source 'https://rubygems.org'
0ad1b18
0ad1b18
gem 'activeresource'
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.
68a0bb3
sed -i "/current_bundle/ s/^/#/" spec/acceptance_spec_helper.rb
68a0bb3
sed -i "/assert_appraisal/ s/^/#/" spec/acceptance_spec_helper.rb
68a0bb3
sed -i "/current_bundle/ s/^/#/" spec/support/unit/load_environment.rb
68a0bb3
sed -i "/assert_appraisal/ s/^/#/" spec/support/unit/load_environment.rb
0ad1b18
68a0bb3
# Avoid bootsnap, listen and puma dependencies.
68a0bb3
sed -i '/rails new/ s/)/ --skip-bootsnap --skip-listen --skip-puma)/' spec/support/unit/rails_application.rb
0ad1b18
68a0bb3
bundle exec rspec spec/unit
6f58083
68a0bb3
# The upream .gemspec is not usable for tests due to depenency on Git.
68a0bb3
ln -sf %{_builddir}/%{gem_name}-%{version}.gemspec %{gem_name}.gemspec
68a0bb3
68a0bb3
# Avoid bootsnap, listen, puma and sprockets dependencies.
68a0bb3
sed -i '/rails new/ s/"$/ --skip-bootsnap --skip-listen --skip-puma --skip-sprockets"/' spec/support/acceptance/helpers/step_helpers.rb
68a0bb3
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
68a0bb3
# Remove useless 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 \\
68a0bb3
        bundle.remove_gem 'chromedriver-helper'" spec/support/acceptance/helpers/step_helpers.rb
6f58083
0ad1b18
bundle exec rspec spec/acceptance
6f58083
6f58083
popd
6f58083
6f58083
%files
6f58083
%dir %{gem_instdir}
6f58083
%exclude %{gem_instdir}/.*
0ad1b18
# This would just complicate licensing due to bundled JS/CSS without any
0ad1b18
# real benefit.
0ad1b18
%exclude %{gem_instdir}/doc_config
0ad1b18
%license %{gem_instdir}/MIT-LICENSE
6f58083
%{gem_libdir}
6f58083
%exclude %{gem_cache}
6f58083
%{gem_spec}
6f58083
6f58083
%files doc
6f58083
%doc %{gem_docdir}
6f58083
%{gem_instdir}/Appraisals
6f58083
%doc %{gem_instdir}/CONTRIBUTING.md
6f58083
%{gem_instdir}/Gemfile*
0ad1b18
%{gem_instdir}/NEWS.md
6f58083
%doc %{gem_instdir}/README.md
6f58083
%{gem_instdir}/Rakefile
68a0bb3
%{gem_instdir}/custom_plan.rb
68a0bb3
%doc %{gem_instdir}/docs
6f58083
%{gem_instdir}/gemfiles
0ad1b18
%{gem_instdir}/script
6f58083
%{gem_instdir}/shoulda-matchers.gemspec
6f58083
%{gem_instdir}/spec
0ad1b18
%{gem_instdir}/tasks
68a0bb3
%{gem_instdir}/zeus.json
6f58083
6f58083
%changelog
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