Sha256: afe1dcf07b466b93b2c36b5f2c5d6a94e735c9c81c34e85ddb7a48f1bc53de67

Contents?: true

Size: 406 Bytes

Versions: 14

Compression:

Stored size: 406 Bytes

Contents

class Templogger
  attr_reader :logger, :log_path

  def initialize(root_path)
    @file = Tempfile.new('foo', root_path)
    @log_path = @file.path
    @logger = Logger.new(@log_path)
  end

  # wait_for_match /Completed TestJobFork/m
  def wait_for_match(match_pattern)
    sleep 0.1 until self.body =~ match_pattern
  end

  def body
    File.read(@log_path)
  end

  def close
    @file.close
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
backburner-1.1.0 test/helpers/templogger.rb
backburner-1.0.0 test/helpers/templogger.rb
backburner-0.4.6 test/helpers/templogger.rb
backburner-0.4.5 test/helpers/templogger.rb
backburner-0.4.4 test/helpers/templogger.rb
backburner-0.4.3 test/helpers/templogger.rb
backburner-0.4.2 test/helpers/templogger.rb
backburner-0.4.1 test/helpers/templogger.rb
backburner-0.4.0 test/helpers/templogger.rb
backburner-0.3.4 test/helpers/templogger.rb
backburner-0.3.3 test/helpers/templogger.rb
backburner-0.3.2 test/helpers/templogger.rb
backburner-0.3.1 test/helpers/templogger.rb
backburner-0.3.0 test/helpers/templogger.rb