Methods
- S
- T
-
- test_create_when_database_exists_outputs_info_to_stderr,
- test_creates_database_with_default_encoding_and_collation,
- test_creates_database_with_given_collation_and_no_encoding,
- test_creates_database_with_given_encoding_and_default_collation,
- test_creates_database_with_given_encoding_and_no_collation,
- test_establishes_connection_to_database,
- test_establishes_connection_without_database
Instance Public methods
setup()
Link
# File activerecord/test/cases/tasks/mysql_rake_test.rb, line 6 def setup @connection = stub(:create_database => true) @configuration = { 'adapter' => 'mysql', 'database' => 'my-app-db' } ActiveRecord::Base.stubs(:connection).returns(@connection) ActiveRecord::Base.stubs(:establish_connection).returns(true) end
test_create_when_database_exists_outputs_info_to_stderr()
Link
# File activerecord/test/cases/tasks/mysql_rake_test.rb, line 58 def test_create_when_database_exists_outputs_info_to_stderr $stderr.expects(:puts).with("my-app-db already exists").once ActiveRecord::Base.connection.stubs(:create_database).raises( ActiveRecord::StatementInvalid.new("Can't create database 'dev'; database exists:") ) ActiveRecord::Tasks::DatabaseTasks.create @configuration end
test_creates_database_with_default_encoding_and_collation()
Link
# File activerecord/test/cases/tasks/mysql_rake_test.rb, line 24 def test_creates_database_with_default_encoding_and_collation @connection.expects(:create_database). with('my-app-db', charset: 'utf8', collation: 'utf8_unicode_ci') ActiveRecord::Tasks::DatabaseTasks.create @configuration end
test_creates_database_with_given_collation_and_no_encoding()
Link
# File activerecord/test/cases/tasks/mysql_rake_test.rb, line 45 def test_creates_database_with_given_collation_and_no_encoding @connection.expects(:create_database). with('my-app-db', collation: 'latin1_swedish_ci') ActiveRecord::Tasks::DatabaseTasks.create @configuration.merge('collation' => 'latin1_swedish_ci') end
test_creates_database_with_given_encoding_and_default_collation()
Link
# File activerecord/test/cases/tasks/mysql_rake_test.rb, line 31 def test_creates_database_with_given_encoding_and_default_collation @connection.expects(:create_database). with('my-app-db', charset: 'utf8', collation: 'utf8_unicode_ci') ActiveRecord::Tasks::DatabaseTasks.create @configuration.merge('encoding' => 'utf8') end
test_creates_database_with_given_encoding_and_no_collation()
Link
# File activerecord/test/cases/tasks/mysql_rake_test.rb, line 38 def test_creates_database_with_given_encoding_and_no_collation @connection.expects(:create_database). with('my-app-db', charset: 'latin1') ActiveRecord::Tasks::DatabaseTasks.create @configuration.merge('encoding' => 'latin1') end
test_establishes_connection_to_database()
Link
test_establishes_connection_without_database()
Link