<commit_before>require 'spec/spec_helper'

require 'spf/controller/application_configuration'

require_relative './reference_configuration'


describe SPF::Controller::ApplicationConfiguration do

  it 'should load application configurations' do
    app_conf = {}
    Dir.foreach(APPLICATION_CONFIG_DIR) do |ac|
      next if File.directory? ac
      app_conf[ac] = SPF::Controller::ApplicationConfiguration.load_from_file(ac)
    end
    app_conf.size.must_equal 1
  end

end<commit_msg>Added test for application configuration<commit_after>require 'spec/spec_helper'

require 'spf/controller/application_configuration'

require_relative './reference_configuration'


describe SPF::Controller::ApplicationConfiguration do

  it 'should correctly detect number of application configurations' do
    app_conf = {}
    Dir.foreach(APPLICATION_CONFIG_DIR) do |ac|
      next if File.directory? ac
      app_conf[ac] = SPF::Controller::ApplicationConfiguration.load_from_file(ac)
    end
    app_conf.size.must_equal 1
  end

  it 'should correctly detect "participants" application priority' do
    app_name = "participants"
    app_conf = SPF::Controller::ApplicationConfiguration.load_from_file(app_name)
    app_conf[app_name.to_sym][:priority].must_equal 50.0
  end

end
{'fraction_non_alphanumeric': 0.08418568056648308, 'fraction_numerical': 0.003933910306845004, 'mean_word_length': 5.174757281553398, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5707002', 'n_tokens_mistral': 376, 'n_tokens_neox': 360, 'n_words': 81}