Skip to content

Commit

Permalink
conn.socket_io is compiled unconditionally now
Browse files Browse the repository at this point in the history
.. so we can remove the guards.
  • Loading branch information
larskanis committed Jan 10, 2020
1 parent 8d5caee commit 3f2612d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 0 additions & 2 deletions spec/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,6 @@ def wait_for_query_result(conn)
else
config.filter_run_excluding :windows
end
config.filter_run_excluding :socket_io unless
PG::Connection.instance_methods.map( &:to_sym ).include?( :socket_io )

config.filter_run_excluding( :postgresql_93 ) if PG.library_version < 90300
config.filter_run_excluding( :postgresql_94 ) if PG.library_version < 90400
Expand Down
12 changes: 6 additions & 6 deletions spec/pg/connection_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
end
end

it "can connect asynchronously", :socket_io do
it "can connect asynchronously" do
tmpconn = described_class.connect_start( @conninfo )
expect( tmpconn ).to be_a( described_class )

Expand All @@ -182,7 +182,7 @@
tmpconn.finish
end

it "can connect asynchronously for the duration of a block", :socket_io do
it "can connect asynchronously for the duration of a block" do
conn = nil

described_class.connect_start(@conninfo) do |tmpconn|
Expand All @@ -196,7 +196,7 @@
expect( conn ).to be_finished()
end

context "with async established connection", :socket_io do
context "with async established connection" do
before :each do
@conn2 = described_class.connect_start( @conninfo )
wait_for_polling_ok(@conn2)
Expand Down Expand Up @@ -902,7 +902,7 @@
end


it "handles server close while asynchronous connect", :socket_io do
it "handles server close while asynchronous connect" do
serv = TCPServer.new( '127.0.0.1', 54320 )
conn = described_class.connect_start( '127.0.0.1', 54320, "", "", "me", "xxxx", "somedb" )
expect( [PG::PGRES_POLLING_WRITING, PG::CONNECTION_OK] ).to include conn.connect_poll
Expand Down Expand Up @@ -963,15 +963,15 @@
conn.close
end

it "closes the IO fetched from #socket_io when the connection is closed", :without_transaction, :socket_io do
it "closes the IO fetched from #socket_io when the connection is closed", :without_transaction do
conn = PG.connect( @conninfo )
io = conn.socket_io
conn.finish
expect( io ).to be_closed()
expect { conn.socket_io }.to raise_error( PG::ConnectionBad, /connection is closed/i )
end

it "closes the IO fetched from #socket_io when the connection is reset", :without_transaction, :socket_io do
it "closes the IO fetched from #socket_io when the connection is reset", :without_transaction do
conn = PG.connect( @conninfo )
io = conn.socket_io
conn.reset
Expand Down

0 comments on commit 3f2612d

Please sign in to comment.