Sha256: fe058a0eddf5fe4bac055ba48c599e5a2a79a08ef7e2ca8fb60099412ddb2fd7

Contents?: true

Size: 388 Bytes

Versions: 6

Compression:

Stored size: 388 Bytes

Contents

require 'tempfile'

module LogfileHelper
  TMP_LOGFILE = Tempfile.new('rack-logstasher-tmp-log')

  def reset_tmp_log
    TMP_LOGFILE.rewind
    TMP_LOGFILE.truncate(0)
  end

  def tmp_logfile_path
    TMP_LOGFILE.path
  end

  def last_log_line
    TMP_LOGFILE.readlines.last
  end
end

RSpec.configuration.include(LogfileHelper)
RSpec.configuration.before :each do
  reset_tmp_log
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rack-logstasher-1.0.2 spec/support/logfile_helper.rb
rack-logstasher-1.0.1 spec/support/logfile_helper.rb
rack-logstasher-1.0.0 spec/support/logfile_helper.rb
rack-logstasher-0.0.3 spec/support/logfile_helper.rb
rack-logstasher-0.0.2 spec/support/logfile_helper.rb
rack-logstasher-0.0.1 spec/support/logfile_helper.rb