diff --git a/rspec-expectations-2.14.5.gem b/rspec-expectations-2.14.5.gem new file mode 100644 index 0000000..2279563 Binary files /dev/null and b/rspec-expectations-2.14.5.gem differ diff --git a/rubygem-rspec-expectations-2.14.5-be_truthy-alias.patch b/rubygem-rspec-expectations-2.14.5-be_truthy-alias.patch new file mode 100644 index 0000000..073ef9f --- /dev/null +++ b/rubygem-rspec-expectations-2.14.5-be_truthy-alias.patch @@ -0,0 +1,13 @@ +--- 2.14.5/TMP/lib/rspec/matchers.rb.be_truthy 1970-01-01 09:00:00.000000000 +0900 ++++ 2.14.5/TMP/lib/rspec/matchers.rb 2014-08-13 16:30:56.000000000 +0900 +@@ -198,6 +198,10 @@ + BuiltIn::BeNil.new + end + ++ alias_method :be_truthy, :be_true ++ alias_method :be_falsey, :be_false ++ alias_method :be_falsy, :be_falsey ++ + # @example + # expect(actual).to be_true + # expect(actual).to be_false diff --git a/rubygem-rspec-expectations-2.14.5-ruby24.patch b/rubygem-rspec-expectations-2.14.5-ruby24.patch new file mode 100644 index 0000000..5aad79b --- /dev/null +++ b/rubygem-rspec-expectations-2.14.5-ruby24.patch @@ -0,0 +1,36 @@ +Only in rspec-expectations-2.14.5: LOGLOG +diff -urp rspec-expectations-2.14.5.orig/spec/rspec/expectations/expectation_target_spec.rb rspec-expectations-2.14.5/spec/rspec/expectations/expectation_target_spec.rb +--- rspec-expectations-2.14.5.orig/spec/rspec/expectations/expectation_target_spec.rb 2017-02-17 19:28:23.271247469 +0900 ++++ rspec-expectations-2.14.5/spec/rspec/expectations/expectation_target_spec.rb 2017-02-17 19:38:18.189674292 +0900 +@@ -51,14 +51,14 @@ module RSpec + end + + it 'fails an invalid negative expectation' do +- message = /expected 5 not to be a kind of Fixnum/ ++ message = /expected 5 not to be a kind of Integer/ + expect { + expect(5).not_to be_a(Fixnum) + }.to fail_with(message) + end + + it 'fails an invalid negative expectation with a split infinitive' do +- message = /expected 5 not to be a kind of Fixnum/ ++ message = /expected 5 not to be a kind of Integer/ + expect { + expect(5).to_not be_a(Fixnum) + }.to fail_with(message) +diff -urp rspec-expectations-2.14.5.orig/spec/rspec/matchers/be_instance_of_spec.rb rspec-expectations-2.14.5/spec/rspec/matchers/be_instance_of_spec.rb +--- rspec-expectations-2.14.5.orig/spec/rspec/matchers/be_instance_of_spec.rb 2017-02-17 19:28:23.271247469 +0900 ++++ rspec-expectations-2.14.5/spec/rspec/matchers/be_instance_of_spec.rb 2017-02-17 19:37:41.285523750 +0900 +@@ -25,9 +25,9 @@ module RSpec + end + + it "provides a description" do +- matcher = be_an_instance_of(Fixnum) ++ matcher = be_an_instance_of(Integer) + matcher.matches?(Numeric) +- expect(matcher.description).to eq "be an instance of Fixnum" ++ expect(matcher.description).to eq "be an instance of Integer" + end + + context "when expected provides an expanded inspect, e.g. AR::Base" do diff --git a/rubygem-rspec2-expectations.spec b/rubygem-rspec2-expectations.spec new file mode 100644 index 0000000..e4a8ab0 --- /dev/null +++ b/rubygem-rspec2-expectations.spec @@ -0,0 +1,80 @@ +%global majorver 2.14.5 +%global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||') +%global fullver %{majorver}%{?preminorver} +%global gem_name rspec-expectations +%global rpmgem_name rspec2-expectations +%global gem_minitest rubygem(minitest4) +%global need_bootstrap_set 0 +%{!?need_bootstrap: %global need_bootstrap %{need_bootstrap_set}} +Summary: Rspec 2 expectations (should and matchers) +Name: rubygem-%{rpmgem_name} +Version: %{majorver} +Release: 1 +License: MIT +URL: http://github.com/rspec/rspec-expectations +Source0: https://rubygems.org/gems/%{gem_name}-%{fullver}.gem +# Backport temporarily be_truthy matchers and so on +Patch0: rubygem-rspec-expectations-2.14.5-be_truthy-alias.patch +# Test suite fix for ruby24 wrt integer unification +Patch1: rubygem-rspec-expectations-2.14.5-ruby24.patch +BuildRequires: ruby(release) rubygems-devel +%if 0%{?need_bootstrap} < 1 +BuildRequires: rubygem(rspec2) %gem_minitest rubygem(test-unit) +%endif +Provides: rubygem(%{rpmgem_name}) = %{version}-%{release} +Obsoletes: rubygem-rspec-expectations < 2.14.5-1 +BuildArch: noarch +%description +rspec-expectations adds `should` and `should_not` to every object and includes +RSpec::Matchers, a library of standard matchers. + +%package doc +Summary: Documentation for %{name} +Requires: %{name} = %{version}-%{release} +Obsoletes: rubygem-rspec-expectations-doc < %{version}-%{release} +%description doc +This package contains documentation for %{name}. + +%prep +gem unpack %{SOURCE0} +%setup -q -D -T -n %{gem_name}-%{version} +%patch0 -p2 +%patch1 -p1 +sed -i -e "s@\(require 'test/unit'\)@gem 'minitest', '~> 4' ;\1@" \ + spec/spec_helper.rb +gem specification %{SOURCE0} -l --ruby > %{gem_name}.gemspec + +%build +gem build %{gem_name}.gemspec +%gem_install + +%install +mkdir -p %{buildroot}%{gem_dir} +cp -a .%{gem_dir}/* \ + %{buildroot}%{gem_dir}/ +rm -f %{buildroot}%{gem_instdir}/{.document,.gitignore,.travis.yml,.yardopts} +%if 0%{?need_bootstrap} < 1 + +%check +LANG=C.UTF-8 +pushd .%{gem_instdir} +ruby -rrubygems -Ilib/ -S rspec2 spec/ +popd +%endif + +%files +%dir %{gem_instdir} +%license %{gem_instdir}/License.txt +%doc %{gem_instdir}/*.md +%{gem_instdir}/lib/ +%exclude %{gem_cache} +%{gem_spec} + +%files doc +%{gem_docdir} +%{gem_instdir}/features/ +%exclude %{gem_instdir}/spec/ + +%changelog +* Wed Aug 19 2020 huangyangke - %{majorver}-1 +- package init diff --git a/rubygem-rspec2-expectations.yaml b/rubygem-rspec2-expectations.yaml new file mode 100644 index 0000000..e42c499 --- /dev/null +++ b/rubygem-rspec2-expectations.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: rspec/rspec-expectations +tag_prefix: "^v" +separator: "."