Class: Spec::Matchers::Migration::HaveTableMatcher
- Inherits:
-
Object
- Object
- Spec::Matchers::Migration::HaveTableMatcher
- Defined in:
- lib/spec/matchers/migration_matchers.rb
Instance Attribute Summary collapse
-
#repository ⇒ Object
Returns the value of attribute repository.
-
#table_name ⇒ Object
Returns the value of attribute table_name.
Instance Method Summary collapse
- #failure_message ⇒ Object
-
#initialize(table_name) ⇒ HaveTableMatcher
constructor
A new instance of HaveTableMatcher.
- #matches?(repository) ⇒ Boolean
- #negative_failure_message ⇒ Object
Constructor Details
#initialize(table_name) ⇒ HaveTableMatcher
Returns a new instance of HaveTableMatcher.
25 26 27 |
# File 'lib/spec/matchers/migration_matchers.rb', line 25 def initialize(table_name) @table_name = table_name end |
Instance Attribute Details
#repository ⇒ Object
Returns the value of attribute repository.
23 24 25 |
# File 'lib/spec/matchers/migration_matchers.rb', line 23 def repository @repository end |
#table_name ⇒ Object
Returns the value of attribute table_name.
23 24 25 |
# File 'lib/spec/matchers/migration_matchers.rb', line 23 def table_name @table_name end |
Instance Method Details
#failure_message ⇒ Object
33 34 35 |
# File 'lib/spec/matchers/migration_matchers.rb', line 33 def %(expected #{repository} to have table '#{table_name}') end |
#matches?(repository) ⇒ Boolean
29 30 31 |
# File 'lib/spec/matchers/migration_matchers.rb', line 29 def matches?(repository) repository.adapter.storage_exists?(table_name) end |
#negative_failure_message ⇒ Object
37 38 39 |
# File 'lib/spec/matchers/migration_matchers.rb', line 37 def %(expected #{repository} to not have table '#{table_name}') end |