Class: RailsAuditLog::Matchers::CreateAuditLogEntry
- Inherits:
-
Object
- Object
- RailsAuditLog::Matchers::CreateAuditLogEntry
- Defined in:
- lib/rails_audit_log/matchers.rb
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
-
#initialize(event:, touching:) ⇒ CreateAuditLogEntry
constructor
A new instance of CreateAuditLogEntry.
- #matches?(block) ⇒ Boolean
- #supports_block_expectations? ⇒ Boolean
- #touching(attribute) ⇒ Object
Constructor Details
#initialize(event:, touching:) ⇒ CreateAuditLogEntry
Returns a new instance of CreateAuditLogEntry.
53 54 55 56 |
# File 'lib/rails_audit_log/matchers.rb', line 53 def initialize(event:, touching:) @event = event @touching = touching end |
Instance Method Details
#description ⇒ Object
82 83 84 |
# File 'lib/rails_audit_log/matchers.rb', line 82 def description "create an audit log entry#{qualifier}" end |
#failure_message ⇒ Object
74 75 76 |
# File 'lib/rails_audit_log/matchers.rb', line 74 def "expected block to create an audit log entry#{qualifier}, but none was created" end |
#failure_message_when_negated ⇒ Object
78 79 80 |
# File 'lib/rails_audit_log/matchers.rb', line 78 def "expected block not to create an audit log entry#{qualifier}, but one was created" end |
#matches?(block) ⇒ Boolean
67 68 69 70 71 72 |
# File 'lib/rails_audit_log/matchers.rb', line 67 def matches?(block) @before = matching_scope.count block.call @after = matching_scope.count @after > @before end |
#supports_block_expectations? ⇒ Boolean
63 64 65 |
# File 'lib/rails_audit_log/matchers.rb', line 63 def supports_block_expectations? true end |
#touching(attribute) ⇒ Object
58 59 60 61 |
# File 'lib/rails_audit_log/matchers.rb', line 58 def touching(attribute) @touching = attribute self end |