From bf8d4f0f0e3f9790b87199d32d546c19f75f41e3 Mon Sep 17 00:00:00 2001 From: Vít Ondruch Date: Jun 25 2021 11:36:55 +0000 Subject: Fix RSpec 3.x compatibility. --- diff --git a/rubygem-expression_parser-0.9.0-Failing-test-case.patch b/rubygem-expression_parser-0.9.0-Failing-test-case.patch new file mode 100644 index 0000000..d8a8621 --- /dev/null +++ b/rubygem-expression_parser-0.9.0-Failing-test-case.patch @@ -0,0 +1,33 @@ +From f267bada1294a0f66f6063195843fccfad876d8f Mon Sep 17 00:00:00 2001 +From: David Ricciardi +Date: Mon, 18 Mar 2013 10:03:16 -0400 +Subject: [PATCH] fixes #2 + +--- + parser_spec.rb | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/parser_spec.rb b/parser_spec.rb +index 5fff1b2..416e8ef 100644 +--- a/parser_spec.rb ++++ b/parser_spec.rb +@@ -33,7 +33,7 @@ + it 'should treat dot separated floating point numbers as a valid input' do + @parser.parse('2.5').should == 2.5 + @parser.parse('4*2.5 + 8.5+1.5 / 3.0').should == 19 +- @parser.parse('5.0005 + 0.0095').should be_close(5.01, 0.01) ++ @parser.parse('5.0005 + 0.0095').should be_within(0.01).of(5.01) + end + + it 'should handle tight expressions' do +@@ -60,8 +60,8 @@ + + it 'should return float pointing numbers when division result is not an integer' do + @parser.parse('10/4').should == 2.5 +- @parser.parse('5/3').should be_close(1.66, 0.01) +- @parser.parse('3 + 8/5 -1 -2*5').should be_close(-6.4, 0.01) ++ @parser.parse('5/3').should be_within(0.01).of(1.66) ++ @parser.parse('3 + 8/5 -1 -2*5').should be_within(0.01).of(-6.4) + end + + it 'should raise an error on wrong token' do diff --git a/rubygem-expression_parser.spec b/rubygem-expression_parser.spec index 9f99fdf..d738edc 100644 --- a/rubygem-expression_parser.spec +++ b/rubygem-expression_parser.spec @@ -2,7 +2,7 @@ Name: rubygem-%{gem_name} Version: 0.9.0 -Release: 17%{?dist} +Release: 18%{?dist} Summary: A math parser License: MIT URL: http://lukaszwrobel.pl/blog/math-parser-part-3-implementation @@ -10,12 +10,14 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem # License is in upstream Git master, but not yet shipped in a released gem. # https://raw.github.com/nricciar/expression_parser/master/MIT-LICENSE Source1: rubygem-expression_parser-MIT-LICENSE +# Fix RSpec 3.x compatibility. +# https://github.com/nricciar/expression_parser/issues/2 +Patch0: rubygem-expression_parser-0.9.0-Failing-test-case.patch Requires: ruby(release) Requires: ruby(rubygems) BuildRequires: ruby(release) BuildRequires: rubygems-devel -# Upstream looks dead, keep with RSpec 2.x for now. -BuildRequires: rubygem(rspec) < 3 +BuildRequires: rubygem(rspec) BuildArch: noarch Provides: rubygem(%{gem_name}) = %{version} @@ -38,6 +40,8 @@ gem unpack %{SOURCE0} gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec +%patch0 -p1 + rm Rakefile sed -ri "s|\"Rakefile\"(\.freeze)?,||g" %{gem_name}.gemspec @@ -56,7 +60,7 @@ install -m 0644 -p %{SOURCE1} %{buildroot}%{gem_instdir}/MIT-LICENSE %check pushd .%{gem_instdir} - rspec2 parser_spec.rb +rspec parser_spec.rb popd %files @@ -72,6 +76,9 @@ popd %exclude %{gem_instdir}/parser_spec.rb %changelog +* Fri Jun 25 2021 Vít Ondruch - 0.9.0-18 +- Fix RSpec 3.x compatibility. + * Wed Jan 27 2021 Fedora Release Engineering - 0.9.0-17 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild