Class: MigrationValidators::Spec::Matchers::DBMatchers::Deny
- Inherits:
-
BaseDbMatcher
- Object
- BaseDbMatcher
- MigrationValidators::Spec::Matchers::DBMatchers::Deny
show all
- Defined in:
- lib/migration_validators/spec/matchers/db_matchers.rb
Instance Method Summary
collapse
#all, #all?, #at_least_one, #at_least_one?, #from, #initial, #initialize, #insert, #insert?, #matches?, #message, #operations_array, #update, #update?, #update_and_insert, #values, #with_message
Instance Method Details
#check_result(value, exception, operation) ⇒ Object
153
154
155
|
# File 'lib/migration_validators/spec/matchers/db_matchers.rb', line 153
def check_result value, exception, operation
super && exception && exception.message =~ /#{message}/
end
|
#failure_message ⇒ Object
158
159
160
161
162
|
# File 'lib/migration_validators/spec/matchers/db_matchers.rb', line 158
def failure_message
compose_message do |operations_name, elements_name, last_message, expected_message|
"expected that operation #{operations_name} would fail for #{elements_name} from #{values} #{expected_message}. But #{last_operation} #{last_message.blank? ? 'successed with ' : 'raised ' + last_message + ' for '}'#{last_value}'"
end
end
|
#negative_failure_message ⇒ Object
164
165
166
167
168
|
# File 'lib/migration_validators/spec/matchers/db_matchers.rb', line 164
def negative_failure_message
compose_message do |operations_name, elements_name, last_message, expected_message|
"not expected that operation #{operations_name} would fail for #{elements_name} from #{values} #{expected_message}. But it happened with #{last_operation} on '#{last_value}'"
end
end
|