diff --git a/rubygem-shoulda-context.spec b/rubygem-shoulda-context.spec new file mode 100644 index 0000000..7cd3fbf --- /dev/null +++ b/rubygem-shoulda-context.spec @@ -0,0 +1,97 @@ +%global gem_name shoulda-context +Name: rubygem-%{gem_name} +Version: 1.2.2 +Release: 2 +Summary: Context framework extracted from Shoulda +License: MIT +URL: https://github.com/thoughtbot/shoulda-context +Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem +BuildRequires: ruby(release) rubygems-devel ruby rubygem(bundler) rubygem(jquery-rails) +BuildRequires: rubygem(mocha) rubygem(rails) rubygem(sass-rails) rubygem(sqlite3) +BuildRequires: rubygem(test-unit) rubygem(did_you_mean) +BuildArch: noarch +%description +Shoulda's contexts make it easy to write understandable and maintainable +tests for Test::Unit. It's fully compatible with your existing tests in +Test::Unit, and requires no retooling to use. +Refer to the shoulda gem if you want to know more about using shoulda +with Rails or RSpec. + +%package doc +Summary: Documentation for %{name} +Requires: %{name} = %{version}-%{release} +BuildArch: noarch +%description doc +Documentation for %{name}. + +%prep +gem unpack %{SOURCE0} +%setup -q -D -T -n %{gem_name}-%{version} +gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec +sed -i 's/\r$//' MIT-LICENSE +sed -i 's|#!/usr/bin/env ruby|#!/usr/bin/ruby|' bin/convert_to_should_syntax +rm test/fake_rails_root/vendor/plugins/.keep +sed -i -r 's|"test/fake_rails_root/vendor/plugins/\.keep"(\.freeze)?,||' %{gem_name}.gemspec + +%build +gem build %{gem_name}.gemspec +%gem_install + +%install +mkdir -p %{buildroot}%{gem_dir} +cp -a .%{gem_dir}/* \ + %{buildroot}%{gem_dir}/ +mkdir -p %{buildroot}%{_bindir} +cp -pa .%{_bindir}/* \ + %{buildroot}%{_bindir}/ +find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x + +%check +pushd .%{gem_instdir} +rm gemfiles/*.lock +%gemspec_remove_dep -s shoulda-context.gemspec -g mocha -d '~> 0.9.10' +%gemspec_add_dep -s shoulda-context.gemspec -g mocha -d '~> 1.0' +%gemspec_remove_dep -s shoulda-context.gemspec -g test-unit -d '~> 2.1.0' +%gemspec_add_dep -s shoulda-context.gemspec -g test-unit -d '~> 3.0' +%gemspec_remove_dep -s shoulda-context.gemspec -g appraisal -d +%gemspec_remove_dep -s shoulda-context.gemspec -g byebug -d +%gemspec_remove_dep -s shoulda-context.gemspec -g pry -d +%gemspec_remove_dep -s shoulda-context.gemspec -g pry-byebug -d +sed -i '/gem "rails"/ s/, :github=>"rails\/rails", :branch=>"4-1-stable"//' gemfiles/rails_4_1.gemfile +sed -i "/require 'mocha'/ s/mocha/mocha\/setup/" test/test_helper.rb +BUNDLE_GEMFILE=gemfiles/test_unit.gemfile bundle exec ruby -Itest -e 'Dir.glob "./test/**/*_test.rb", &method(:require)' +BUNDLE_GEMFILE=gemfiles/minitest_5_x.gemfile bundle exec ruby -Itest -e 'Dir.glob "./test/**/*_test.rb", &method(:require)' +BUNDLE_GEMFILE=gemfiles/rails_4_1.gemfile bundle exec ruby -Itest -e 'Dir.glob "./test/**/*_test.rb", &method(:require)' +popd + +%files +%dir %{gem_instdir} +%{_bindir}/convert_to_should_syntax +%exclude %{gem_instdir}/.* +%license %{gem_instdir}/MIT-LICENSE +%{gem_instdir}/bin +%{gem_libdir} +%exclude %{gem_cache} +%{gem_spec} + +%files doc +%doc %{gem_docdir} +%doc %{gem_instdir}/CONTRIBUTING.md +%{gem_instdir}/Appraisals +%{gem_instdir}/Gemfile +%doc %{gem_instdir}/README.md +%{gem_instdir}/gemfiles +%{gem_instdir}/init.rb +%dir %{gem_instdir}/rails +%{gem_instdir}/rails/init.rb +%{gem_instdir}/Rakefile +%exclude %{gem_instdir}/shoulda-context.gemspec +%{gem_instdir}/tasks +%{gem_instdir}/test + +%changelog +* Sat Mar 5 2022 liyanan - 1.2.2-2 +- fix build error + +* Fri Aug 21 2020 shenleizhao - 1.2.2-1 +- package init diff --git a/rubygem-shoulda-context.yaml b/rubygem-shoulda-context.yaml new file mode 100644 index 0000000..cda9e43 --- /dev/null +++ b/rubygem-shoulda-context.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: thoughtbot/shoulda-context +tag_prefix: "v" +separator: "." diff --git a/shoulda-context-1.2.2.gem b/shoulda-context-1.2.2.gem new file mode 100644 index 0000000..9f93a90 Binary files /dev/null and b/shoulda-context-1.2.2.gem differ