Sha256: 06bc415f38ebc8b84cb4c13507f06edecb9dd945e60613d98fc6a28d830eff88

Contents?: true

Size: 764 Bytes

Versions: 1

Compression:

Stored size: 764 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + "/../test_helper")

class MysqlReplicationHelper::ErrorHandlerTest < Test::Unit::TestCase
  def test_responses
    handler = MysqlReplicationHelper::ErrorHandler.new
    
    [
      [
        "Error 'Unknown database 'example_db'' on query. Default database: 'example_db'.",
        [ "CREATE DATABASE `example_db`", "START SLAVE" ]
      ],
      [
        "Error 'There is no 'example'@'localhost' registered' on query. Default database: 'example_db'.",
        [ "CREATE USER `example`@`localhost`", "GRANT ALL PRIVILEGES ON `example_db`.* TO `example`@`localhost`", "START SLAVE" ]
      ]
    ].each do |test_case|
      assert_equal test_case[1], handler.sql_to_recover_from(test_case[0])
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
theworkinggroup-mysql-replication-helper-0.0.1 test/mysql_replication_helper/error_handler_test.rb