I have a patch to add schema[1] support to the postgresql adapter, but I don''t how to go about creating proper unit tests. Should I add a new postgresql db_definition with required fixtures and test with that? Should I modify the main postgresql db_definition so that one or more of the tables are in an altertnate schema? Should I create a test that creates it''s own PostgreSQLAdapter via ActiveRecord::Base.establish_connection and then go about creating a new schema for testing, and perform some standard tests? any advice/direction is appreciated, I''m new to AR fixtures. Dave [1] See http://www.postgresql.org/docs/8.0/interactive/ddl-schemas.html and/or http://sql-info.de/postgresql/schemas.html
Jeremy Kemper
2005-Mar-12 04:54 UTC
Re: how to create unit tests for postgresql schema support
Dave Lee wrote:> I have a patch to add schema[1] support to the postgresql adapter, but > I don''t how to go about creating proper unit tests. Should I add a > new postgresql db_definition with required fixtures and test with > that? Should I modify the main postgresql db_definition so that one > or more of the tables are in an altertnate schema? Should I create a > test that creates it''s own PostgreSQLAdapter via > ActiveRecord::Base.establish_connection and then go about creating a > new schema for testing, and perform some standard tests?The first option is by far the most comprehensive, ensuring that everything works with a new schema. The second option requires a new set of test cases: bah. The third option sounds like a restatement of the first. So I''d go with the first. jeremy