init rubygem-rspec2-expectations package

This commit is contained in:
PokeHuang 2020-08-25 14:43:59 +08:00
parent 536965f09c
commit b63e322a08
5 changed files with 133 additions and 0 deletions

Binary file not shown.

View File

@ -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

View File

@ -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

View File

@ -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 <huangyangke@huawei.com> - %{majorver}-1
- package init

View File

@ -0,0 +1,4 @@
version_control: github
src_repo: rspec/rspec-expectations
tag_prefix: "^v"
separator: "."