require"cases/helper"require'models/post'require'models/comment'moduleActiveRecordmoduleConnectionAdaptersclassMysql2SchemaTest<ActiveRecord::TestCasefixtures:postsdefsetup@connection=ActiveRecord::Base.connectiondb=Post.connection_pool.spec.config[:database]table=Post.table_name@db_name=db@omgpost=Class.new(Post)doset_table_name"#{db}.#{table}"defself.name;'Post';endendenddeftest_schemaassert@omgpost.find(:first)enddeftest_table_exists?name=@omgpost.table_nameassert@connection.table_exists?(name),"#{name} table should exist"enddeftest_table_exists_wrong_schemaassert(!@connection.table_exists?("#{@db_name}.zomg"),"table should not exist")endendendend