diff options
Diffstat (limited to 'activerecord/test/cases/sqlite_rake_test.rb')
-rw-r--r-- | activerecord/test/cases/sqlite_rake_test.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/activerecord/test/cases/sqlite_rake_test.rb b/activerecord/test/cases/sqlite_rake_test.rb index 69fb129326..b5557fc953 100644 --- a/activerecord/test/cases/sqlite_rake_test.rb +++ b/activerecord/test/cases/sqlite_rake_test.rb @@ -145,4 +145,26 @@ module ActiveRecord FileUtils.rm(dbfile) end end + + class SqliteStructureLoadTest < ActiveRecord::TestCase + def setup + @database = "db_create.sqlite3" + @configuration = { + 'adapter' => 'sqlite3', + 'database' => @database + } + end + + def test_structure_load + dbfile = @database + filename = "awesome-file.sql" + + open(filename, 'w') { |f| f.puts("select datetime('now', 'localtime');") } + ActiveRecord::Tasks::DatabaseTasks.structure_load @configuration, filename, '/rails/root' + assert File.exists?(dbfile) + ensure + FileUtils.rm(filename) + FileUtils.rm(dbfile) + end + end end |