Class: MySQLExpectations::Matchers::HaveEngineType
- Inherits:
-
Object
- Object
- MySQLExpectations::Matchers::HaveEngineType
- Defined in:
- lib/mysql_expectations/matchers/table_have_engine_type.rb
Overview
A matcher that check a table’s engine type
Instance Attribute Summary collapse
-
#expected_engine_type ⇒ Object
readonly
Returns the value of attribute expected_engine_type.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Instance Method Summary collapse
- #actual_engine_type ⇒ Object
- #description ⇒ Object
- #failure_message ⇒ Object
-
#initialize(expected_engine_type) ⇒ HaveEngineType
constructor
A new instance of HaveEngineType.
- #matches?(table) ⇒ Boolean
Constructor Details
#initialize(expected_engine_type) ⇒ HaveEngineType
Returns a new instance of HaveEngineType.
12 13 14 15 |
# 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 |
Instance Attribute Details
#expected_engine_type ⇒ Object (readonly)
Returns the value of attribute expected_engine_type.
10 11 12 |
# File 'lib/mysql_expectations/matchers/table_have_engine_type.rb', line 10 def expected_engine_type @expected_engine_type end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
10 11 12 |
# File 'lib/mysql_expectations/matchers/table_have_engine_type.rb', line 10 def table @table end |
Instance Method Details
#actual_engine_type ⇒ Object
17 18 19 |
# File 'lib/mysql_expectations/matchers/table_have_engine_type.rb', line 17 def actual_engine_type table.engine_type end |
#description ⇒ Object
26 27 28 |
# File 'lib/mysql_expectations/matchers/table_have_engine_type.rb', line 26 def description "have engine type '#{expected_engine_type}'" end |
#failure_message ⇒ Object
30 31 32 33 34 |
# File 'lib/mysql_expectations/matchers/table_have_engine_type.rb', line 30 def "expected '#{table.name}' table engine type to be " \ "'#{expected_engine_type}' " \ "but it was '#{actual_engine_type}'" end |
#matches?(table) ⇒ Boolean
21 22 23 24 |
# File 'lib/mysql_expectations/matchers/table_have_engine_type.rb', line 21 def matches?(table) @table = table actual_engine_type == expected_engine_type end |