Sha256: d778c46eb634ff61d83f4e02d5ddf363671f26c66fb9293adf18f0e30ee7711b

Contents?: true

Size: 658 Bytes

Versions: 5

Compression:

Stored size: 658 Bytes

Contents

# Provides an in-memory backend that stores all exception reports in
# an array. This is mostly useful for tests, and probably shouldn't be
# used in real code.
class ErrorStalker::Backend::InMemory < ErrorStalker::Backend::Base

  # A list of exceptions stored in this backend.
  attr_reader :exceptions

  # Create a new instance of this backend, with an empty exception
  # list.
  def initialize
    clear
  end

  # Stores exception_report in the exceptions list.
  def report(exception_report)
    @exceptions << exception_report
  end

  # Clears the exception list. Pretty useful in a test +setup+ method!
  def clear
    @exceptions = []
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
error_stalker-0.0.16 lib/error_stalker/backend/in_memory.rb
error_stalker-0.0.15 lib/error_stalker/backend/in_memory.rb
error_stalker-0.0.14 lib/error_stalker/backend/in_memory.rb
error_stalker-0.0.13 lib/error_stalker/backend/in_memory.rb
error_stalker-0.0.12 lib/error_stalker/backend/in_memory.rb