Sha256: 79847292ef713c6055402384da52eac51342a5c8d6f97ad64d673f0b2a91e886

Contents?: true

Size: 619 Bytes

Versions: 2

Compression:

Stored size: 619 Bytes

Contents

require_relative 'integration_test_base'

module Filum

  class StdOutLoggerTest < Minitest::Test
    include IntegrationTestBase

    def setup
      super

      @filename = "/tmp/log/filum_stdout_test_#{Time.now.to_i}.log"
      $stdout.expects(:write).at_least_once.with do |data|
        File.open(@filename, "a") do |file|
          file.write(data)
        end
      end

      Filum.setup($stdout)
    end

    def teardown
      super
      mocha_teardown
    end

    def assert_logged(regex)
      assert File.readlines(@filename).grep(regex).size == 1, "Pattern (#{regex}) was not found"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
filum-2.2.1 test/integration/stdout_logger_test.rb
filum-2.2.0 test/integration/stdout_logger_test.rb