Skip to content

Commit 521a6ee

Browse files
committed
[CI] Test Runner: Fix compare strings for empty in test runner
1 parent bae27ee commit 521a6ee

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

api-spec-testing/rspec_matchers.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def compare_string(expected, actual_value, test, response)
238238
# different from what Ruby uses, so we transform X.XXXXEXX to X.XXXXXe+XX
239239
# to be able to compare the values
240240
actual_value.to_s == expected.gsub('E', 'e+')
241-
elsif expected == ''
241+
elsif expected == '' && actual_value != ''
242242
actual_value == response
243243
else
244244
expected == actual_value

elasticsearch-xpack/spec/xpack/rest_api_yaml_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
next
3131
end
3232

33-
context "#{file.gsub("#{YAML_FILES_DIRECTORY}/", '')}" do
33+
ctx = file.gsub("#{YAML_FILES_DIRECTORY}/", '')
34+
context ctx do
3435
before(:all) do
3536
# Runs once before all tests in a test file
3637
Elasticsearch::RestAPIYAMLTests::TestFile.wipe_cluster(ADMIN_CLIENT)

0 commit comments

Comments
 (0)