From 79405a07a45dfaeb6c39d794b42b72ee73e420e9 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 18 Mar 2014 19:06:44 -0700 Subject: Extract with_example_table into helper method. This setups the helper method which other tests can benefit from. --- activerecord/test/support/ddl_helper.rb | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 activerecord/test/support/ddl_helper.rb (limited to 'activerecord/test/support/ddl_helper.rb') diff --git a/activerecord/test/support/ddl_helper.rb b/activerecord/test/support/ddl_helper.rb new file mode 100644 index 0000000000..0107babaaf --- /dev/null +++ b/activerecord/test/support/ddl_helper.rb @@ -0,0 +1,8 @@ +module DdlHelper + def with_example_table(connection, table_name, definition = nil) + connection.exec_query("CREATE TABLE #{table_name}(#{definition})") + yield + ensure + connection.exec_query("DROP TABLE #{table_name}") + end +end -- cgit v1.2.3