Methods
S
T
Instance Public methods
setup()
# File activerecord/test/cases/tasks/mysql_rake_test.rb, line 213
def setup
  @connection    = stub(:recreate_database => true)
  @configuration = {
    'adapter'  => 'mysql2',
    'database' => 'test-db'
  }

  ActiveRecord::Base.stubs(:connection).returns(@connection)
  ActiveRecord::Base.stubs(:establish_connection).returns(true)
end
test_establishes_connection_to_the_appropriate_database()
# File activerecord/test/cases/tasks/mysql_rake_test.rb, line 224
def test_establishes_connection_to_the_appropriate_database
  ActiveRecord::Base.expects(:establish_connection).with(@configuration)

  ActiveRecord::Tasks::DatabaseTasks.purge @configuration
end
test_recreates_database_with_no_default_options()
# File activerecord/test/cases/tasks/mysql_rake_test.rb, line 230
def test_recreates_database_with_no_default_options
  @connection.expects(:recreate_database).
    with('test-db', {})

  ActiveRecord::Tasks::DatabaseTasks.purge @configuration
end
test_recreates_database_with_the_given_options()
# File activerecord/test/cases/tasks/mysql_rake_test.rb, line 237
def test_recreates_database_with_the_given_options
  @connection.expects(:recreate_database).
    with('test-db', charset: 'latin', collation: 'latin1_swedish_ci')

  ActiveRecord::Tasks::DatabaseTasks.purge @configuration.merge(
    'encoding' => 'latin', 'collation' => 'latin1_swedish_ci')
end