Class: Spec::Matchers::Migration::HaveTableMatcher
- Defined in:
- lib/gems/dm-migrations-0.9.9/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.
26 27 28 |
# File 'lib/gems/dm-migrations-0.9.9/lib/spec/matchers/migration_matchers.rb', line 26 def initialize(table_name) @table_name = table_name end |
Instance Attribute Details
#repository ⇒ Object
Returns the value of attribute repository.
24 25 26 |
# File 'lib/gems/dm-migrations-0.9.9/lib/spec/matchers/migration_matchers.rb', line 24 def repository @repository end |
#table_name ⇒ Object
Returns the value of attribute table_name.
24 25 26 |
# File 'lib/gems/dm-migrations-0.9.9/lib/spec/matchers/migration_matchers.rb', line 24 def table_name @table_name end |
Instance Method Details
#failure_message ⇒ Object
34 35 36 |
# File 'lib/gems/dm-migrations-0.9.9/lib/spec/matchers/migration_matchers.rb', line 34 def %(expected #{repository} to have table '#{table_name}') end |
#matches?(repository) ⇒ Boolean
30 31 32 |
# File 'lib/gems/dm-migrations-0.9.9/lib/spec/matchers/migration_matchers.rb', line 30 def matches?(repository) repository.adapter.storage_exists?(table_name) end |
#negative_failure_message ⇒ Object
38 39 40 |
# File 'lib/gems/dm-migrations-0.9.9/lib/spec/matchers/migration_matchers.rb', line 38 def %(expected #{repository} to not have table '#{table_name}') end |