From 9b467561e2d49bd3e9805c77e6facef57a682178 Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Feb 06 2017 06:29:41 +0000 Subject: Fix for Ruby 2.4.0 compatibility. --- diff --git a/rubygem-rspec-support-3.6.0.beta2-fix-for-ruby-2.4.0-tests.patch b/rubygem-rspec-support-3.6.0.beta2-fix-for-ruby-2.4.0-tests.patch new file mode 100644 index 0000000..1498f18 --- /dev/null +++ b/rubygem-rspec-support-3.6.0.beta2-fix-for-ruby-2.4.0-tests.patch @@ -0,0 +1,73 @@ +diff --git a/spec/rspec/support/fuzzy_matcher_spec.rb b/spec/rspec/support/fuzzy_matcher_spec.rb +index fc92ec5..2c0abec 100644 +--- a/spec/rspec/support/fuzzy_matcher_spec.rb ++++ b/spec/rspec/support/fuzzy_matcher_spec.rb +@@ -120,17 +120,17 @@ module RSpec + end + + it 'does the fuzzy matching on the individual elements' do +- expect([String, Fixnum]).to match_against(["a", 2]) +- expect([String, Fixnum]).not_to match_against([2, "a"]) ++ expect([String, Integer]).to match_against(["a", 2]) ++ expect([String, Integer]).not_to match_against([2, "a"]) + end + + it 'returns false if they have a different number of elements' do +- expect([String, Fixnum]).not_to match_against(['a', 2, nil]) ++ expect([String, Integer]).not_to match_against(['a', 2, nil]) + end + + it 'supports arbitrary nested arrays' do + a1 = [ +- [String, Fixnum, [be_within(0.1).of(2)]], ++ [String, Integer, [be_within(0.1).of(2)]], + 3, [[[ /foo/ ]]] + ] + +@@ -154,8 +154,8 @@ module RSpec + end + end.new + +- expect([Fixnum, String]).to match_against(my_enum) +- expect([String, Fixnum]).not_to match_against(my_enum) ++ expect([Integer, String]).to match_against(my_enum) ++ expect([String, Integer]).not_to match_against(my_enum) + end + + it 'does not match an empty hash against an empty array or vice-versa' do +@@ -192,7 +192,7 @@ module RSpec + it 'supports arbitrary nested hashes' do + h1 = { + :a => { +- :b => [String, Fixnum], ++ :b => [String, Integer], + :c => { :d => be_within(0.1).of(2) } + } + } +diff --git a/spec/rspec/support/object_formatter_spec.rb b/spec/rspec/support/object_formatter_spec.rb +index 7e16fb5..6eed58c 100644 +--- a/spec/rspec/support/object_formatter_spec.rb ++++ b/spec/rspec/support/object_formatter_spec.rb +@@ -82,10 +82,19 @@ module RSpec + + let(:formatted_decimal) { ObjectFormatter.format(decimal) } + +- it 'fails with a conventional representation of the decimal' do +- in_sub_process_if_possible do +- require 'bigdecimal' +- expect(formatted_decimal).to include('3.3 (#= '2.4' ++ it "uses Ruby's BigDecimal formatting since it is improved in 2.4+" do ++ in_sub_process_if_possible do ++ require 'bigdecimal' ++ expect(formatted_decimal).to eq('0.33e1') ++ end ++ end ++ else ++ it 'includes a conventional representation of the decimal' do ++ in_sub_process_if_possible do ++ require 'bigdecimal' ++ expect(formatted_decimal).to include('3.3 (#= '2.4' ++ end + end + end + end diff --git a/rubygem-rspec-support.spec b/rubygem-rspec-support.spec index 18eb14d..2452f1e 100644 --- a/rubygem-rspec-support.spec +++ b/rubygem-rspec-support.spec @@ -3,7 +3,7 @@ %global mainver 3.5.0 %undefine prever -%global mainrel 1 +%global mainrel 2 %global prerpmver %(echo "%{?prever}" | sed -e 's|\\.||g') %global need_bootstrap_set 0 @@ -22,6 +22,10 @@ Source1: rubygem-%{gem_name}-%{version}-full.tar.gz Source2: rspec-related-create-full-tarball.sh # tweak regex for search path Patch0: rubygem-rspec-support-3.2.1-callerfilter-searchpath-regex.patch +# Fix for Ruby 2.4.0 compatiblity. +# https://github.com/rspec/rspec-support/commit/725fc24 +Patch1: rubygem-rspec-support-3.6.0.beta2-fix-for-ruby-2.4.0.patch +Patch2: rubygem-rspec-support-3.6.0.beta2-fix-for-ruby-2.4.0-tests.patch #BuildRequires: ruby(release) BuildRequires: rubygems-devel @@ -33,8 +37,6 @@ BuildRequires: git %endif BuildArch: noarch -# Need fix -Provides: rubygem(%{gem_name}) = %{version}-%{release} %description `RSpec::Support` provides common functionality to `RSpec::Core`, @@ -61,6 +63,7 @@ gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec ( cd %{gem_name}-%{version} %patch0 -p1 +%patch1 -p1 ) %build @@ -77,6 +80,8 @@ cp -pa .%{gem_dir}/* \ LANG=en_US.UTF-8 pushd %{gem_name}-%{version} +cat %{PATCH2} | patch -p1 + # Test failure needs investigation... FAILFILE=() FAILTEST=() @@ -111,6 +116,9 @@ popd %doc %{gem_docdir} %changelog +* Fri Feb 03 2017 Jun Aruga - 3.5.0-2 +- Fix for Ruby 2.4.0 compatibility. + * Sun Jul 24 2016 Mamoru TASAKA - 3.5.0-1 - Enable tests again