Updates matcher regular expression for big numbers

Signed-off-by: jwhl <shilei1@xfusion.com>
This commit is contained in:
jwhl 2024-11-15 07:41:53 +00:00 committed by Gitee
parent e34ed72e1b
commit 63f291718d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 31 additions and 2 deletions

View File

@ -0,0 +1,24 @@
From 6c251fbc2891006b1ab514ae7f833576da668292 Mon Sep 17 00:00:00 2001
From: Fernando Briano <fernando@picandocodigo.net>
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

View File

@ -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 <shilei1@xfusion.com> - 7.14.0-3
- Updates matcher regular expression for big numbers
* Wed Feb 23 2022 baizhonggui <baizhonggui@huawei.com> - 7.14.0-2
- Add git buildrequire for fixing build error