Permalink
Browse files

Add specs for bad int2vector/money typecasting on PostgreSQL

  • Loading branch information...
1 parent e3a47cb commit 1563a11c9a343a913c4ad149f0cacec4452a1f73 @jeremyevans committed Jan 14, 2013
Showing with 8 additions and 0 deletions.
  1. +8 −0 spec/adapters/postgres_spec.rb
View
8 spec/adapters/postgres_spec.rb
@@ -61,6 +61,14 @@ def logger.method_missing(m, msg)
@db.server_version.should > 70000
end
+ specify "should not typecast the int2vector type incorrectly" do
+ @db.get(Sequel.cast('10 20', :int2vector)).should_not == 10
+ end
+
+ cspecify "should not typecast the money type incorrectly", :do do
+ @db.get(Sequel.cast('10.01', :money)).should_not == 0
+ end
+
specify "should correctly parse the schema" do
@db.schema(:public__testfk, :reload=>true).should == [
[:id, {:type=>:integer, :ruby_default=>nil, :db_type=>"integer", :default=>"nextval('testfk_id_seq'::regclass)", :oid=>23, :primary_key=>true, :allow_null=>false}],

0 comments on commit 1563a11

Please sign in to comment.