invidious/lib/pg/spec/pq/connection_spec.cr
Leon Klingele 40fb17791e
shard: track dependencies
Commit the whole ./lib/ folder which stores the Crystal dependencies.
This has a few benefits:

- Allows to build the project without a connection to the Internet
  to retrieve dependencies.
- Makes the project resistant against dependency re-tags which might
  include malicious code.
2019-08-15 01:51:27 +02:00

29 lines
766 B
Crystal

require "../spec_helper"
module PG
class Connection
getter connection
end
end
describe PQ::Connection, "#server_parameters" do
it "ParameterStatus frames in response to set are handeled" do
get = ->{ PG_DB.using_connection &.connection.server_parameters["standard_conforming_strings"] }
get.call.should eq("on")
PG_DB.exec "set standard_conforming_strings to on"
get.call.should eq("on")
PG_DB.exec "set standard_conforming_strings to off"
get.call.should eq("off")
PG_DB.exec "set standard_conforming_strings to default"
get.call.should eq("on")
end
end
describe PQ::Connection do
it "handles empty queries" do
PG_DB.exec ""
PG_DB.query("") { }
PG_DB.query_one("select 1", &.read).should eq(1)
end
end