<commit_before>
#
# testing ruote
#
# Sat Sep 20 23:40:10 JST 2008
#

require 'fileutils'

require File.join(File.dirname(__FILE__), '..', 'test_helper.rb')
require File.join(File.dirname(__FILE__), 'storage_helper.rb')

require 'ruote/engine'
require 'ruote/worker'
require 'ruote/parser/ruby_dsl'


module FunctionalBase

  def setup

    #require 'ruote/util/look'
    #Ruote::Look.dump_lsof
    #Ruote::Look.dump_lsof_count

    @engine =
      Ruote::Engine.new(
        Ruote::Worker.new(
          determine_storage(
            's_logger' => [ 'ruote/log/test_logger', 'Ruote::TestLogger' ])))

    #p @engine.storage.class

    @tracer = Tracer.new

    @engine.add_service('tracer', @tracer)

    #noisy # uncommented, it makes all the tests noisy
  end

  def teardown

    @engine.shutdown
    @engine.context.storage.purge!
  end

  def assert_log_count (count, &block)

    c = @engine.context.logger.log.select(&block).size

    #logger.to_stdout if ( ! @engine.context[:noisy]) && c != count

    assert_equal count, c
  end<commit_msg>functional tests : -n makes test "noisy"<commit_after>
#
# testing ruote
#
# Sat Sep 20 23:40:10 JST 2008
#

require 'fileutils'

require File.join(File.dirname(__FILE__), '..', 'test_helper.rb')
require File.join(File.dirname(__FILE__), 'storage_helper.rb')

require 'ruote/engine'
require 'ruote/worker'
require 'ruote/parser/ruby_dsl'


module FunctionalBase

  def setup

    #require 'ruote/util/look'
    #Ruote::Look.dump_lsof
    #Ruote::Look.dump_lsof_count

    @engine =
      Ruote::Engine.new(
        Ruote::Worker.new(
          determine_storage(
            's_logger' => [ 'ruote/log/test_logger', 'Ruote::TestLogger' ])))

    #p @engine.storage.class

    @tracer = Tracer.new

    @engine.add_service('tracer', @tracer)

    noisy if ARGV.include?('-n')

    #noisy # uncommented, it makes all the tests noisy
  end

  def teardown

    @engine.shutdown
    @engine.context.storage.purge!
  end

  def assert_log_count (count, &block)

    c = @engine.context.logger.log.select(&block).size

    #logger.to_stdout if ( ! @engine.context[:noisy]) && c != count

    assert_equal count, c
  end
{'fraction_non_alphanumeric': 0.1371824480369515, 'fraction_numerical': 0.011085450346420323, 'mean_word_length': 3.314741035856574, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6476639', 'n_tokens_mistral': 824, 'n_tokens_neox': 760, 'n_words': 153}