From 8128c9764cea884423ba39dacbe38410236ef1b2 Mon Sep 17 00:00:00 2001 From: jwhl Date: Fri, 15 Nov 2024 07:41:53 +0000 Subject: [PATCH] Updates matcher regular expression for big numbers Signed-off-by: jwhl (cherry picked from commit 63f291718d3ec5390849cf4126b906031f532c02) --- ...Updates-matcher-regular-expression-f.patch | 24 +++++++++++++++++++ rubygem-elasticsearch-ruby.spec | 9 +++++-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 0001-API-Test-Runner-Updates-matcher-regular-expression-f.patch diff --git a/0001-API-Test-Runner-Updates-matcher-regular-expression-f.patch b/0001-API-Test-Runner-Updates-matcher-regular-expression-f.patch new file mode 100644 index 0000000..969e3c3 --- /dev/null +++ b/0001-API-Test-Runner-Updates-matcher-regular-expression-f.patch @@ -0,0 +1,24 @@ +From 6c251fbc2891006b1ab514ae7f833576da668292 Mon Sep 17 00:00:00 2001 +From: Fernando Briano +Date: Fri, 20 Aug 2021 10:58:23 +0100 +Subject: [PATCH] [API] Test Runner: Updates matcher regular expression for big numbers + +--- + api-spec-testing/rspec_matchers.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/api-spec-testing/rspec_matchers.rb b/api-spec-testing/rspec_matchers.rb +index ea698219d..277e24ae1 100644 +--- a/api-spec-testing/rspec_matchers.rb ++++ b/api-spec-testing/rspec_matchers.rb +@@ -233,7 +233,7 @@ RSpec::Matchers.define :match_response do |pairs, test| + parsed = parsed.gsub(/\$\{?#{match.first}\}?/, test.cached_values[match.first]) + end + /#{parsed.tr("/", "")}/ =~ actual_value +- elsif !!(expected.match?(/^[0-9]{1}\.[0-9]+E[0-9]+/)) ++ elsif !!(expected.match?(/^-?[0-9]{1}\.[0-9]+E[0-9]+/)) + # When the value in the yaml test is a big number, the format is + # different from what Ruby uses, so we transform X.XXXXEXX to X.XXXXXe+XX + # to be able to compare the values +-- +2.33.0 \ No newline at end of file diff --git a/rubygem-elasticsearch-ruby.spec b/rubygem-elasticsearch-ruby.spec index dc67503..a954e1a 100644 --- a/rubygem-elasticsearch-ruby.spec +++ b/rubygem-elasticsearch-ruby.spec @@ -3,12 +3,14 @@ %global elastic_prefix elasticsearch Name: rubygem-elasticsearch-ruby Version: 7.14.0 -Release: 2 +Release: 3 Summary: Ruby integrations for Elasticsearch License: Apache-2.0 URL: https://github.com/elastic/elasticsearch-ruby Source0: https://github.com/elastic/elasticsearch-ruby/archive/v%{version}/elasticsearch-ruby-%{version}.tar.gz +Patch0: 0001-API-Test-Runner-Updates-matcher-regular-expression-f.patch + BuildRequires: ruby BuildRequires: ruby-devel BuildRequires: rubygems @@ -67,7 +69,7 @@ BuildArch: noarch Ruby client for Elasticsearch. See the `elasticsearch` gem for full integration. %prep -%autosetup -n elasticsearch-ruby-%{version} +%autosetup -n elasticsearch-ruby-%{version} -p1 %build for gem_name in %{elastic_prefix} %{elastic_prefix}-api %{elastic_prefix}-transport ; @@ -137,6 +139,9 @@ done %{gem_dir}/doc/%{elastic_prefix}-transport-%{version}/* %changelog +* Fri Nov 15 2024 - 7.14.0-3 +- Updates matcher regular expression for big numbers + * Wed Feb 23 2022 baizhonggui - 7.14.0-2 - Add git buildrequire for fixing build error -- Gitee