Sha256: 2a2f8778ecfecf5915c32dc5cb23a3b43b556a3957a53586ae6009f894297597

Contents?: true

Size: 1.18 KB

Versions: 50

Compression:

Stored size: 1.18 KB

Contents

#!/usr/bin/env rspec
# encoding: utf-8

require_relative 'helpers'

require 'pg'

describe PG do

	it "knows what version of the libpq library is loaded", :postgresql_91 do
		expect( PG.library_version ).to be_an( Integer )
		expect( PG.library_version ).to be >= 90100
	end

	it "can select which of both security libraries to initialize" do
		# This setting does nothing here, because there is already a connection
		# to the server, at this point in time.
		PG.init_openssl(false, true)
		PG.init_openssl(1, 0)
	end

	it "can select whether security libraries to initialize" do
		# This setting does nothing here, because there is already a connection
		# to the server, at this point in time.
		PG.init_ssl(false)
		PG.init_ssl(1)
	end


	it "knows whether or not the library is threadsafe" do
		expect( PG ).to be_threadsafe()
	end

	it "does have hierarchical error classes" do
		expect( PG::UndefinedTable.ancestors[0,4] ).to eq([
				PG::UndefinedTable,
				PG::SyntaxErrorOrAccessRuleViolation,
				PG::ServerError,
		        PG::Error
		        ])

		expect( PG::InvalidSchemaName.ancestors[0,3] ).to eq([
				PG::InvalidSchemaName,
				PG::ServerError,
		        PG::Error
		        ])
	end

end

Version data entries

50 entries across 50 versions & 4 rubygems

Version Path
pg-0.21.0-x64-mingw32 spec/pg_spec.rb
pg-0.21.0-x86-mingw32 spec/pg_spec.rb
pg-0.21.0 spec/pg_spec.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/pg-0.20.0/spec/pg_spec.rb
pg-0.20.0-x86-mingw32 spec/pg_spec.rb
pg-0.20.0-x64-mingw32 spec/pg_spec.rb
pg-0.20.0 spec/pg_spec.rb
autocompl-0.2.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/pg-0.19.0/spec/pg_spec.rb
pg-0.19.1.pre20170124220800-x64-mingw32 spec/pg_spec.rb
pg-0.19.1.pre20170124220800-x86-mingw32 spec/pg_spec.rb
pg-0.19.1.pre20170124220800 spec/pg_spec.rb
pg-0.19.1.pre20170115074000-x64-mingw32 spec/pg_spec.rb
pg-0.19.1.pre20170115074000-x86-mingw32 spec/pg_spec.rb
pg-0.19.1.pre20170115074000 spec/pg_spec.rb
pg-0.19.0.pre20170115074000 spec/pg_spec.rb
pg-0.19.0-x86-mingw32 spec/pg_spec.rb
pg-0.19.0-x64-mingw32 spec/pg_spec.rb
pg-0.19.0 spec/pg_spec.rb
pg-0.19.0.pre20160904200247-x86-mingw32 spec/pg_spec.rb
pg-0.19.0.pre20160904200247-x64-mingw32 spec/pg_spec.rb