diff options
author | Simon Jefford <simon.jefford@gmail.com> | 2012-06-18 20:49:52 +0100 |
---|---|---|
committer | Simon Jefford <simon.jefford@gmail.com> | 2012-06-19 15:15:47 +0100 |
commit | 363ab882165dc89a642c4fed01417bd64cdce0a8 (patch) | |
tree | 8f70dd921b3d88140ad1ee884ab6bee6d7f789c8 /activerecord/test/cases/sqlite_rake_test.rb | |
parent | 4d69cdbdd75f5a9594055099770c4c3d0ffeb98d (diff) | |
download | rails-363ab882165dc89a642c4fed01417bd64cdce0a8.tar.gz rails-363ab882165dc89a642c4fed01417bd64cdce0a8.tar.bz2 rails-363ab882165dc89a642c4fed01417bd64cdce0a8.zip |
Refactor db:charset task
In a similar vein to Pat's work on create, drop etc, the db:charset
task is now a one liner in databases.rake
Diffstat (limited to 'activerecord/test/cases/sqlite_rake_test.rb')
-rw-r--r-- | activerecord/test/cases/sqlite_rake_test.rb | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/activerecord/test/cases/sqlite_rake_test.rb b/activerecord/test/cases/sqlite_rake_test.rb index f68809bfda..cfca937a24 100644 --- a/activerecord/test/cases/sqlite_rake_test.rb +++ b/activerecord/test/cases/sqlite_rake_test.rb @@ -103,4 +103,24 @@ module ActiveRecord ActiveRecord::Tasks::DatabaseTasks.drop @configuration, '/rails/root' end end -end
\ No newline at end of file + + class SqliteDBCharsetTest < ActiveRecord::TestCase + def setup + @database = 'db_create.sqlite3' + @connection = stub :connection + @configuration = { + 'adapter' => 'sqlite3', + 'database' => @database + } + + File.stubs(:exist?).returns(false) + ActiveRecord::Base.stubs(:connection).returns(@connection) + ActiveRecord::Base.stubs(:establish_connection).returns(true) + end + + def test_db_retrieves_charset + @connection.expects(:encoding) + ActiveRecord::Tasks::DatabaseTasks.charset @configuration, '/rails/root' + end + end +end |