<commit_before>require 'helper'

class TestArchitecture < Test::Unit::TestCase
  include Adaptable
  
  def test_should_be_able_to_access_parser
    assert(defined?(Parser), "Architecture::Parser undefined")
  end

  def test_should_have_working_fixture
    f = Fixture.new('Smiley')
    assert(f.name == 'Smiley', "Fixture broken")
  end
  
  def test_should_be_able_to_create_instance_with_fixture
    fixture = Fixture.new('xml')
    parser  = Parser.new(fixture)
    assert_equal(fixture, parser.fixture)
  end
  
  def test_should_load_custom_parser_dynamically
    fixture = Fixture.new('xml')
    assert Parser.for(fixture).is_a?(XmlParser), 'XmlParser not loading properly'
  end
  
  def test_should_cleanly_handle_missing_parsers
    assert_raise(Parser::UndefinedParserError) do
      fixture = Fixture.new('bogus')
      Parser.for(fixture)
    end
  end
  
  def test_should_actually_be_usable
    fixture = Fixture.new('xml')
    assert_equal '<xml />', Parser.for(fixture).to_s
  end
  
  def test_should_skip_broken_files
    assert_raise(Parser::UndefinedParserError) do
      fixture = Fixture.new('broken')
      Parser.for(fixture)
    end
  end
  
end<commit_msg>another test with no method error confirmation<commit_after>require 'helper'

class TestArchitecture < Test::Unit::TestCase
  include Adaptable
  
  def test_should_be_able_to_access_parser
    assert(defined?(Parser), "Architecture::Parser undefined")
  end

  def test_should_have_working_fixture
    f = Fixture.new('Smiley')
    assert(f.name == 'Smiley', "Fixture broken")
  end
  
  def test_should_be_able_to_create_instance_with_fixture
    fixture = Fixture.new('xml')
    parser  = Parser.new(fixture)
    assert_equal(fixture, parser.fixture)
  end
  
  def test_should_load_custom_parser_dynamically
    fixture = Fixture.new('xml')
    assert Parser.for(fixture).is_a?(XmlParser), 'XmlParser not loading properly'
  end
  
  def test_should_cleanly_handle_missing_parsers
    assert_raise(Parser::UndefinedParserError) do
      fixture = Fixture.new('bogus')
      Parser.for(fixture)
    end
  end
  
  def test_should_actually_be_usable
    fixture = Fixture.new('xml')
    assert_equal '<xml />', Parser.for(fixture).to_s
  end
  
  def test_should_skip_broken_files
    assert_raise(Parser::UndefinedParserError) do
      fixture = Fixture.new('broken')
      Parser.for(fixture)
    end
  end
  
  def test_should_skip_invalid_parsers
    assert_raise(Parser::UndefinedParserError) do
      fixture = 'fail'
      Parser.for(fixture)
    end
  end
  
end
{'fraction_non_alphanumeric': 0.08841940532081377, 'fraction_numerical': 0.0, 'mean_word_length': 4.103792415169661, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '5598640', 'n_tokens_mistral': 874, 'n_tokens_neox': 866, 'n_words': 152}