rubygem-pg/SOURCES/rubygem-pg-1.1.3-Fix-specs-...

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