Class: RSpec::Rails::Matchers::BeANewRecord
- Inherits:
-
Matchers::BuiltIn::BaseMatcher
- Object
- Matchers::BuiltIn::BaseMatcher
- RSpec::Rails::Matchers::BeANewRecord
- Defined in:
- lib/rspec/rails/matchers/be_new_record.rb
Instance Method Summary collapse
- #failure_message_for_should ⇒ Object
- #failure_message_for_should_not ⇒ Object
- #matches?(actual) ⇒ Boolean private
Instance Method Details
#failure_message_for_should ⇒ Object
9 10 11 |
# File 'lib/rspec/rails/matchers/be_new_record.rb', line 9 def "expected #{actual.inspect} to be a new record, but was persisted" end |
#failure_message_for_should_not ⇒ Object
13 14 15 |
# File 'lib/rspec/rails/matchers/be_new_record.rb', line 13 def "expected #{actual.inspect} to be persisted, but was a new record" end |
#matches?(actual) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
5 6 7 |
# File 'lib/rspec/rails/matchers/be_new_record.rb', line 5 def matches?(actual) !actual.persisted? end |