spec/schemata_spec.rb in sequel-postgres-schemata-0.0.3 vs spec/schemata_spec.rb in sequel-postgres-schemata-0.0.4
- old
+ new
@@ -1,10 +1,11 @@
require 'spec_helper'
describe Sequel::Postgres::Schemata do
let(:db) { Sequel::connect adapter: 'postgres', search_path: %w(foo public) }
+ let(:plain_db) { Sequel::connect adapter: 'postgres' }
describe "#schemata" do
it "lists all existing schematas" do
schemata = db.schemata
schemata.should include(:public)
@@ -14,10 +15,14 @@
describe "#search_path" do
it "returns the search path" do
db.search_path.should == %i(foo public)
end
+
+ it "correctly handles the default list" do
+ expect(plain_db.search_path).to eq(%i($user public))
+ end
end
describe "#search_path=" do
it "accepts a single symbol" do
db.search_path = :bar
@@ -42,12 +47,12 @@
it "accepts a string list" do
db.search_path = %w(bar baz)
db.search_path.should == %i(bar baz)
end
- it "quotes the string list" do
- db.search_path = %w(bar, baz)
- db.search_path.should == %i(bar, baz)
+ it "quotes the string list correctly" do
+ db.search_path = ["bar\" ',", "baz"]
+ db.search_path.should == [:"bar\" ',", :baz]
end
end
describe "#current_schemata" do
it "returns the current schemata" do