spec/schemata_spec.rb in sequel-postgres-schemata-0.1.0 vs spec/schemata_spec.rb in sequel-postgres-schemata-0.1.1
- old
+ new
@@ -28,9 +28,23 @@
db.search_path.should == %i(bar)
end
db.search_path.should == %i(foo public)
end
+ it "resets the search path when the given block raises an error" do
+ class MyContrivedError < StandardError; end
+
+ begin
+ db.search_path :bar do
+ db.search_path.should == %i(bar)
+ raise MyContrivedError.new
+ end
+ rescue MyContrivedError
+ # Gobble.
+ end
+ db.search_path.should == %i(foo public)
+ end
+
it "accepts symbols as arglist" do
db.search_path :bar, :baz do
db.search_path.should == %i(bar baz)
end
db.search_path.should == %i(foo public)