<commit_before>require 'spec_helper'

describe Hieracles::Registry do
	let(:base) { File.expand_path('../../../', __FILE__)}

  describe '.farms' do
    let(:options) do
      { 
        config: 'spec/files/config.yml', 
        basepath: 'spec/files'
      }
    end
    let(:config) { Hieracles::Config.new options }
    let(:expected) { [
        File.join(config.basepath, 'farm_modules', 'dev.pp'),
        File.join(config.basepath, 'farm_modules', 'dev2.pp'),
        File.join(config.basepath, 'farm_modules', 'dev4.pp')
    ] }
    it { expect(Hieracles::Registry.farms config).to eq expected }
  end

  describe '.nodes' do
    let(:options) do
      { 
        config: 'spec/files/config.yml',
        basepath: 'spec/files'
      }
    end
    let(:expected) { [
    		'server.example.com',
    		'server2.example.com',
    		'server3.example.com',
    		'server4.example.com'
  	] }
    let(:config) { Hieracles::Config.new options }
    it { expect(Hieracles::Registry.nodes config).to eq expected }
  end

  describe '.modules' do<commit_msg>fix test<commit_after>require 'spec_helper'

describe Hieracles::Registry do
	let(:base) { File.expand_path('../../../', __FILE__)}

  describe '.farms' do
    let(:options) do
      { 
        config: 'spec/files/config.yml', 
        basepath: 'spec/files'
      }
    end
    let(:config) { Hieracles::Config.new options }
    let(:expected) { [
        'dev',
        'dev2',
        'dev4'
    ] }
    it { expect(Hieracles::Registry.farms config).to eq expected }
  end

  describe '.nodes' do
    let(:options) do
      { 
        config: 'spec/files/config.yml',
        basepath: 'spec/files'
      }
    end
    let(:expected) { [
    		'server.example.com',
    		'server2.example.<EMAIL>',
    		'server3.example.com',
    		'server4.example.com'
  	] }
    let(:config) { Hieracles::Config.new options }
    it { expect(Hieracles::Registry.nodes config).to eq expected }
  end

  describe '.modules' do
{'fraction_non_alphanumeric': 0.1577079107505071, 'fraction_numerical': 0.005070993914807302, 'mean_word_length': 2.395869191049914, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '7556947', 'n_tokens_mistral': 684, 'n_tokens_neox': 666, 'n_words': 122}