rubygem-elasticsearch-ruby/0001-API-Test-Runner-Updates-matcher-regular-expression-f.patch

24 lines
1.1 KiB
Diff
Raw Permalink Normal View History

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