Skip to content

Commit 8c1d664

Browse files
committed
test: fix hash expression incompatibility
Since Ruby 3.4, evaluated Hash notation was changed. Before: :symbol => value After: symbol: value To keep compatibility, embed evaluated hash. It fixes the following error: Failure: test_writes_to_extracted_host_with_placeholder_replaced_in_exception_message(ElasticsearchOutputTest::HostnamePlaceholders) /work/fluent/plugins/fluent-plugin-elasticsearch.work/test/plugin/test_out_elasticsearch.rb:5008:in 'ElasticsearchOutputTest::HostnamePlaceholders#test_writes_to_extracted_host_with_placeholder_replaced_in_exception_message' <"could not push logs to Elasticsearch cluster ({:host=>\"myhost-1\", :port=>9200, :scheme=>\"http\"}): [503] "> expected but was <"could not push logs to Elasticsearch cluster ({host: \"myhost-1\", port: 9200, scheme: \"http\"}): [503] "> Signed-off-by: Kentaro Hayashi <[email protected]>
1 parent 0d24bb6 commit 8c1d664

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/plugin/test_out_elasticsearch.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5005,7 +5005,8 @@ def test_writes_to_extracted_host_with_placeholder_replaced_in_exception_message
50055005
driver.feed(time.to_i, sample_record.merge({"pipeline_id" => pipeline_id}))
50065006
end
50075007
}
5008-
assert_equal("could not push logs to Elasticsearch cluster ({:host=>\"myhost-1\", :port=>9200, :scheme=>\"http\"}): [503] ", exception.message)
5008+
params = {:host=> "myhost-1", :port=>9200, :scheme=>"http"}
5009+
assert_equal("could not push logs to Elasticsearch cluster (#{params}): [503] ", exception.message)
50095010
end
50105011
end
50115012

0 commit comments

Comments
 (0)