2020-08-28 14:20:55 +08:00
|
|
|
%global gem_name shoulda-matchers
|
2023-01-17 14:54:09 +08:00
|
|
|
Name: rubygem-%{gem_name}
|
2023-11-16 16:17:56 +08:00
|
|
|
Version: 5.3.0
|
2023-01-17 14:54:09 +08:00
|
|
|
Release: 1
|
|
|
|
|
Summary: Making tests easy on the fingers and eyes
|
|
|
|
|
License: MIT
|
|
|
|
|
URL: https://github.com/thoughtbot/shoulda-matchers
|
|
|
|
|
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
|
2022-06-29 18:08:21 +08:00
|
|
|
# git clone https://github.com/thoughtbot/shoulda-matchers.git && cd shoulda-matchers
|
2023-11-16 16:17:56 +08:00
|
|
|
# git archive -v -o shoulda-matchers-5.3.0-specs.tar.gz v5.3.0 spec/
|
2023-01-17 14:54:09 +08:00
|
|
|
Source1: %{gem_name}-%{version}-specs.tar.gz
|
|
|
|
|
|
|
|
|
|
BuildRequires: ruby(release) rubygems-devel ruby rubygem(bcrypt) rubygem(jbuilder)
|
|
|
|
|
BuildRequires: rubygem(puma) rubygem(rails) rubygem(rails-controller-testing) rubygem(rspec) rubygem(rspec-rails)
|
|
|
|
|
BuildRequires: rubygem(shoulda-context) rubygem(spring) rubygem(sqlite3)
|
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
2020-08-28 14:20:55 +08:00
|
|
|
%description
|
|
|
|
|
shoulda-matchers provides Test::Unit- and RSpec-compatible one-liners that
|
|
|
|
|
test common Rails functionality. These tests would otherwise be much longer,
|
|
|
|
|
more complex, and error-prone.
|
|
|
|
|
|
|
|
|
|
%package doc
|
|
|
|
|
Summary: Documentation for %{name}
|
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
BuildArch: noarch
|
|
|
|
|
%description doc
|
|
|
|
|
Documentation for %{name}.
|
|
|
|
|
|
|
|
|
|
%prep
|
2022-06-29 18:08:21 +08:00
|
|
|
%setup -q -n %{gem_name}-%{version} -b 1
|
|
|
|
|
|
2020-08-28 14:20:55 +08:00
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
gem build ../%{gem_name}-%{version}.gemspec
|
|
|
|
|
%gem_install
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
mkdir -p %{buildroot}%{gem_dir}
|
|
|
|
|
cp -a .%{gem_dir}/* \
|
|
|
|
|
%{buildroot}%{gem_dir}/
|
|
|
|
|
|
2023-01-17 14:54:09 +08:00
|
|
|
|
|
|
|
|
|
2020-08-28 14:20:55 +08:00
|
|
|
%check
|
|
|
|
|
pushd .%{gem_instdir}
|
2022-06-29 18:08:21 +08:00
|
|
|
ln -s %{_builddir}/spec spec
|
2020-08-28 14:20:55 +08:00
|
|
|
cat << GF > Gemfile
|
|
|
|
|
source 'https://rubygems.org'
|
2022-06-29 18:08:21 +08:00
|
|
|
gem 'actiontext'
|
2020-08-28 14:20:55 +08:00
|
|
|
gem 'bcrypt'
|
|
|
|
|
gem 'rails'
|
|
|
|
|
gem 'rails-controller-testing'
|
|
|
|
|
gem 'rspec'
|
|
|
|
|
gem 'rspec-rails'
|
|
|
|
|
gem 'sqlite3'
|
|
|
|
|
gem 'spring'
|
|
|
|
|
GF
|
|
|
|
|
sed -i "/require 'pry/ s/^/#/" spec/spec_helper.rb
|
2022-06-29 18:08:21 +08:00
|
|
|
sed -i "/current_bundle/ s/^/#/" \
|
|
|
|
|
spec/acceptance_spec_helper.rb \
|
|
|
|
|
spec/support/unit/load_environment.rb
|
|
|
|
|
sed -i "/CurrentBundle/ s/^/#/" \
|
|
|
|
|
spec/acceptance_spec_helper.rb \
|
|
|
|
|
spec/support/unit/load_environment.rb
|
2023-01-17 14:54:09 +08:00
|
|
|
sed -i '/def rails_new_command/,/^ end$/ {
|
|
|
|
|
/rails new/ s/"$/ --skip-git --skip-asset-pipeline&/
|
|
|
|
|
}' \
|
|
|
|
|
spec/support/unit/rails_application.rb
|
|
|
|
|
sed -i '/def rails_new_command/,/^ end$/ {
|
|
|
|
|
/rails new/ s/"$/ --skip-git --skip-asset-pipeline&/
|
|
|
|
|
}' \
|
2022-06-29 18:08:21 +08:00
|
|
|
spec/support/acceptance/helpers/step_helpers.rb
|
2023-01-17 14:54:09 +08:00
|
|
|
sed -i '/def load_file/,/end/ s/::load_file/::unsafe_load_file/' spec/support/tests/database_configuration.rb
|
2022-06-29 18:08:21 +08:00
|
|
|
|
2020-08-28 14:20:55 +08:00
|
|
|
bundle exec rspec spec/unit
|
2023-01-17 14:54:09 +08:00
|
|
|
|
2020-08-28 14:20:55 +08:00
|
|
|
sed -i "/add_gem 'spring-commands-rspec'/ s/^/#/" spec/support/acceptance/helpers/step_helpers.rb
|
2023-01-17 14:54:09 +08:00
|
|
|
sed -i "/updating_bundle do |bundle|/a \\
|
|
|
|
|
bundle.add_gem 'spring'" spec/support/acceptance/helpers/step_helpers.rb
|
2020-08-28 14:20:55 +08:00
|
|
|
sed -i "/updating_bundle do |bundle|/a \\
|
|
|
|
|
bundle.remove_gem 'capybara'" spec/support/acceptance/helpers/step_helpers.rb
|
|
|
|
|
sed -i "/updating_bundle do |bundle|/a \\
|
|
|
|
|
bundle.remove_gem 'selenium-webdriver'" spec/support/acceptance/helpers/step_helpers.rb
|
|
|
|
|
sed -i "/updating_bundle do |bundle|/a \\
|
2023-01-17 14:54:09 +08:00
|
|
|
bundle.remove_gem 'debug'" spec/support/acceptance/helpers/step_helpers.rb
|
|
|
|
|
|
|
|
|
|
bundle exec rspec spec/acceptance
|
|
|
|
|
|
2020-08-28 14:20:55 +08:00
|
|
|
popd
|
|
|
|
|
|
2023-01-17 14:54:09 +08:00
|
|
|
|
2020-08-28 14:20:55 +08:00
|
|
|
%files
|
|
|
|
|
%dir %{gem_instdir}
|
2022-06-29 18:08:21 +08:00
|
|
|
%license %{gem_instdir}/LICENSE
|
2020-08-28 14:20:55 +08:00
|
|
|
%{gem_libdir}
|
|
|
|
|
%exclude %{gem_cache}
|
|
|
|
|
%{gem_spec}
|
|
|
|
|
|
|
|
|
|
%files doc
|
|
|
|
|
%doc %{gem_docdir}
|
|
|
|
|
%doc %{gem_instdir}/README.md
|
|
|
|
|
%doc %{gem_instdir}/docs
|
|
|
|
|
%{gem_instdir}/shoulda-matchers.gemspec
|
|
|
|
|
|
|
|
|
|
%changelog
|
2023-11-16 16:17:56 +08:00
|
|
|
* Thu Nov 16 2023 Ge Wang <wang__ge@126.com> - 5.3.0-1
|
|
|
|
|
- update to 5.3.0
|
|
|
|
|
|
2023-01-17 14:54:09 +08:00
|
|
|
* Tue Jan 17 2023 wulei <wulei80@h-partners.com> - 5.1.0-1
|
|
|
|
|
- update to 5.1.0
|
|
|
|
|
|
2022-06-29 18:08:21 +08:00
|
|
|
* Wed Jun 29 2022 liyanan <liyanan32@h-partners.com> - 4.5.1-1
|
|
|
|
|
- Upgrade to version 4.5.1
|
|
|
|
|
|
2022-03-03 17:02:21 +08:00
|
|
|
* Thu Mar 3 2022 liyanan <liyanan32@huawei.com> - 3.1.2-2
|
|
|
|
|
- fix build error
|
|
|
|
|
|
2020-08-28 14:20:55 +08:00
|
|
|
* Mon Aug 10 2020 yanan li <liyanan032@huawei.com> - 3.1.2-1
|
|
|
|
|
- Package init
|