Sha256: afe67eed3a6caa3e922efde70f15ce1801ecf47a7293933a3f6ebc9c3998b3c4

Contents?: true

Size: 782 Bytes

Versions: 5

Compression:

Stored size: 782 Bytes

Contents

require 'test_helper'
require 'error_stalker/backend/log_file'
require 'tempfile'

class BackendLogFileTest < Test::Unit::TestCase

  def setup
    super
    filename = File.join(Dir.tmpdir, 'exceptions.log')
    @backend = ErrorStalker::Backend::LogFile.new(filename)
    @exception_report = ErrorStalker::ExceptionReport.new(:application => :unit_test, :exception => 'Test Exception', :data => {:name => 'Bob'})
  end

  def teardown
    File.delete(@backend.filename) if File.exists?(@backend.filename)
    super
  end
  
  def test_report_is_implemented
    @backend.report(@exception_report)
    exception_string = File.read(@backend.filename)
    assert_match /Application: unit_test/, exception_string
    assert_match /Exception: Test Exception/, exception_string
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
error_stalker-0.0.16 test/unit/backend/log_file_test.rb
error_stalker-0.0.15 test/unit/backend/log_file_test.rb
error_stalker-0.0.14 test/unit/backend/log_file_test.rb
error_stalker-0.0.13 test/unit/backend/log_file_test.rb
error_stalker-0.0.12 test/unit/backend/log_file_test.rb