<commit_before>require File.join(File.dirname(__FILE__), 'test_helper')

class Boson::RepoTest < Test::Unit::TestCase
  context "config" do
    before(:all) { reset }
    before(:each) { @repo = Boson::Repo.new('.') }

    test "reloads config when passed true" do
      @repo.config.object_id.should_not == @repo.config(true).object_id
    end

    test "reads existing config correctly" do
      expected_hash = {:commands=>{'c1'=>{}}, :libraries=>{}}
      YAML.expects(:load_file).returns(expected_hash)
      @repo.config[:commands]['c1'].should == {}
    end

    test "ignores nonexistent file and sets config defaults" do
      assert @repo.config[:commands].is_a?(Hash) && @repo.config[:libraries].is_a?(Hash)
    end
  end
end<commit_msg>fixed test creating local config directory<commit_after>require File.join(File.dirname(__FILE__), 'test_helper')

class Boson::RepoTest < Test::Unit::TestCase
  context "config" do
    before(:all) { reset }
    before(:each) { @repo = Boson::Repo.new(File.dirname(__FILE__)) }

    test "reloads config when passed true" do
      @repo.config.object_id.should_not == @repo.config(true).object_id
    end

    test "reads existing config correctly" do
      expected_hash = {:commands=>{'c1'=>{}}, :libraries=>{}}
      YAML.expects(:load_file).returns(expected_hash)
      @repo.config[:commands]['c1'].should == {}
    end

    test "ignores nonexistent file and sets config defaults" do
      assert @repo.config[:commands].is_a?(Hash) && @repo.config[:libraries].is_a?(Hash)
    end
  end
end
{'fraction_non_alphanumeric': 0.15414507772020725, 'fraction_numerical': 0.0025906735751295338, 'mean_word_length': 4.1158940397351, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '3902245', 'n_tokens_mistral': 496, 'n_tokens_neox': 490, 'n_words': 106}