class MySQLExpectations::Matchers::HaveEngineType

A matcher that check a table’s engine type

Attributes

expected_engine_type[R]
table[R]

Public Class Methods

new(expected_engine_type) click to toggle source
# File lib/mysql_expectations/matchers/table_have_engine_type.rb, line 12
def initialize(expected_engine_type)
  @expected_engine_type = expected_engine_type
  @table = nil
end

Public Instance Methods

actual_engine_type() click to toggle source
# File lib/mysql_expectations/matchers/table_have_engine_type.rb, line 17
def actual_engine_type
  table.engine_type
end
description() click to toggle source
# File lib/mysql_expectations/matchers/table_have_engine_type.rb, line 26
def description
  "have engine type '#{expected_engine_type}'"
end
failure_message() click to toggle source
# File lib/mysql_expectations/matchers/table_have_engine_type.rb, line 30
def failure_message
  "expected '#{table.name}' table engine type to be " \
    "'#{expected_engine_type}' " \
    "but it was '#{actual_engine_type}'"
end
matches?(table) click to toggle source
# File lib/mysql_expectations/matchers/table_have_engine_type.rb, line 21
def matches?(table)
  @table = table
  actual_engine_type == expected_engine_type
end