rubygem-pg/rubygem-pg-1.1.3-Fix-specs-for-PostgreSQL-11.patch
Jarek Prokop 5b3ca7e154 Fix FTBFS with PostgreSQL 10.6 and above.
This is required for the ruby:2.5 module build in CentOS 8 Stream.
It will treat the module build that fixes ticked marked below in "Related"
as a completely new modular build, so it cannot use previous modular
build result.

Upstream commits:
a07b7192b7
f4c55ad7ce

Related: rhbz#2210326
2023-06-26 17:32:56 +02:00

33 lines
1.1 KiB
Diff

# HG changeset patch
# User Lars Kanis <lars@greiz-reinsdorf.de>
# Date 1545850926 -3600
# Node ID 74879444e437d42028a636425a4482467a65a711
# Parent 626befee1debcc59472051e64f9ff067522fc3e1
Fix specs for PostgreSQL-11
PG-11 changed the way how/when parameters are interpret.
Fixes 287: https://bitbucket.org/ged/ruby-pg/issues/287/pg-connection-server-ping-returns-correct
diff --git a/spec/pg/connection_spec.rb b/spec/pg/connection_spec.rb
--- a/spec/pg/connection_spec.rb
+++ b/spec/pg/connection_spec.rb
@@ -1099,8 +1099,16 @@
expect( ping ).to eq( PG::PQPING_NO_RESPONSE )
end
+ it "returns error when ping connection arguments are wrong" do
+ ping = described_class.ping('localhost', 'localhost', nil, nil, :test, nil, nil)
+ expect( ping ).to_not eq( PG::PQPING_OK )
+ end
+
it "returns correct response when ping connection arguments are wrong" do
- ping = described_class.ping('localhost', 'localhost', nil, nil, :test, nil, nil)
+ ping = described_class.ping(
+ :host => 'localhost',
+ :invalid_option => 9999,
+ :dbname => :test)
expect( ping ).to eq( PG::PQPING_NO_ATTEMPT )
end