Sha256: 273854f5891bde58b2ec11c5cbbcca360dc20fba032f82847c3d8d48ca08c791

Contents?: true

Size: 1.06 KB

Versions: 42

Compression:

Stored size: 1.06 KB

Contents

require 'test_helper'

class LogFileTest < Test::Unit::TestCase
  include Sprout::TestHelper

  context "A LogFile" do

    setup do
      @logger = StringIO.new
      @flashlog = File.join(fixtures, 'flashlog.txt')
      @reader = FlashPlayer::LogFile.new
      @reader.logger = @logger
      @reader.stubs(:flashlog_path).returns @flashlog

      FileUtils.touch @flashlog
    end

    teardown do
      remove_file @flashlog
    end

    should "read until killed" do
      blocked = true
      t = Thread.new {
        @reader.tail
        blocked = false
      }

      assert blocked
      t.kill
    end


    # This method only works when run alone -
    # Under normal circumstances, the Sprout::TestHelper
    # clears out any Rake tasks that have been defined
    # and we don't have an easy way to redefine the
    # task...
    #should "read from rake task" do
      #FlashPlayer::LogFile.any_instance.stubs(:logger).returns StringIO.new
      #FlashPlayer::LogFile.any_instance.expects(:read_flashlog_at)
      #Rake.application[:flashlog].invoke
    #end

  end
end

Version data entries

42 entries across 42 versions & 3 rubygems

Version Path
flashsdk_sqe-0.0.7 test/unit/flashplayer_log_file_test.rb
flashsdk_sqe-0.0.6 test/unit/flashplayer_log_file_test.rb
flashsdk_sqe-0.0.4 test/unit/flashplayer_log_file_test.rb
flashsdk_sqe-0.0.3 test/unit/flashplayer_log_file_test.rb
flashsdk_sqe-0.0.2 test/unit/flashplayer_log_file_test.rb
flashsdk_sqe-0.0.1 test/unit/flashplayer_log_file_test.rb
flashsdk-1.1.36.pre test/unit/flashplayer_log_file_test.rb
flashsdk-1.0.34.pre test/unit/flashplayer_log_file_test.rb
flashsdk-1.0.33.pre test/unit/flashplayer_log_file_test.rb
flashsdk-1.0.29.pre test/unit/flashplayer_log_file_test.rb
flashsdk-1.0.28.pre test/unit/flashplayer_log_file_test.rb
flashsdk-1.0.27.pre test/unit/flashplayer_log_file_test.rb
flashsdk-1.0.26.pre test/unit/flashplayer_log_file_test.rb
flashsdk-1.0.25.pre test/unit/flashplayer_log_file_test.rb
flashsdk-1.0.23.pre test/unit/flashplayer_log_file_test.rb
flashsdk-1.0.22.pre test/unit/flashplayer_log_file_test.rb
flashsdk-1.0.21.pre test/unit/flashplayer_log_file_test.rb
flashsdk-1.0.20.pre test/unit/flashplayer_log_file_test.rb
flashsdk-1.0.18.pre test/unit/flashplayer_log_file_test.rb
flashsdk-1.0.17.pre test/unit/flashplayer_log_file_test.rb