diff options
-rw-r--r-- | activerecord/test/cases/tasks/mysql_rake_test.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/activerecord/test/cases/tasks/mysql_rake_test.rb b/activerecord/test/cases/tasks/mysql_rake_test.rb index 97d283bf14..69a049fcfa 100644 --- a/activerecord/test/cases/tasks/mysql_rake_test.rb +++ b/activerecord/test/cases/tasks/mysql_rake_test.rb @@ -74,8 +74,9 @@ module ActiveRecord $stdout.stubs(:print).returns(nil) @error.stubs(:errno).returns(1045) ActiveRecord::Base.stubs(:connection).returns(@connection) - ActiveRecord::Base.stubs(:establish_connection).raises(@error).then. - returns(true) + ActiveRecord::Base.stubs(:establish_connection). + raises(@error). + then.returns(true) end def test_root_password_is_requested @@ -86,12 +87,12 @@ module ActiveRecord end def test_connection_established_as_root - ActiveRecord::Base.expects(:establish_connection).with({ + ActiveRecord::Base.expects(:establish_connection).with( 'adapter' => 'mysql', 'database' => nil, 'username' => 'root', 'password' => 'secret' - }) + ) ActiveRecord::Tasks::DatabaseTasks.create @configuration end @@ -111,12 +112,12 @@ module ActiveRecord def test_connection_established_as_normal_user ActiveRecord::Base.expects(:establish_connection).returns do - ActiveRecord::Base.expects(:establish_connection).with({ + ActiveRecord::Base.expects(:establish_connection).with( 'adapter' => 'mysql', 'database' => 'my-app-db', 'username' => 'pat', 'password' => 'secret' - }) + ) raise @error end @@ -178,18 +179,17 @@ module ActiveRecord def test_recreates_database_with_the_default_options @connection.expects(:recreate_database). - with('test-db', { :charset => 'utf8', :collation => 'utf8_unicode_ci' }) + with('test-db', charset: 'utf8', collation: 'utf8_unicode_ci') ActiveRecord::Tasks::DatabaseTasks.purge @configuration end def test_recreates_database_with_the_given_options @connection.expects(:recreate_database). - with('test-db', { :charset => 'latin', :collation => 'latin_ci' }) + with('test-db', charset: 'latin', collation: 'latin1_swedish_ci') ActiveRecord::Tasks::DatabaseTasks.purge @configuration.merge( - 'encoding' => 'latin', 'collation' => 'latin_ci' - ) + 'encoding' => 'latin', 'collation' => 'latin1_swedish_ci') end end |