<commit_before>class TestTest < MicroTest::Test

  before :all do
    @Test = Class.new(MicroTest::Test)
  end

  test "interface" do
    assert @Test.respond_to?(:inherited)
    assert @Test.respond_to?(:notify)
    assert @Test.respond_to?(:callbacks)
    assert @Test.respond_to?(:invoke)
    assert @Test.respond_to?(:before)
    assert @Test.respond_to?(:after)
    assert @Test.respond_to?(:tests)
    assert @Test.respond_to?(:test)
    assert @Test.respond_to?(:assert)
  end

  test "callbacks data structure" do
    assert @Test.callbacks.is_a?(Hash)
    assert @Test.callbacks[:before].is_a?(Hash)
    assert @Test.callbacks[:after].is_a?(Hash)
  end

  test "callbacks" do
    a = lambda {}
    b = lambda {}
    c = lambda {}
    d = lambda {}
    @Test.before(:all, &a)
    @Test.before(:each, &b)
    @Test.after(:each, &c)
    @Test.after(:all, &d)
    assert @Test.callbacks[:before][:all].equal?(a)
    assert @Test.callbacks[:before][:each].equal?(b)
    assert @Test.callbacks[:after][:each].equal?(c)
    assert @Test.callbacks[:after][:all].equal?(d)
  end

end<commit_msg>Added a failing test for the demo.<commit_after>class TestTest < MicroTest::Test

  before :all do
    @Test = Class.new(MicroTest::Test)
  end

  test "interface" do
    assert @Test.respond_to?(:inherited)
    assert @Test.respond_to?(:notify)
    assert @Test.respond_to?(:callbacks)
    assert @Test.respond_to?(:invoke)
    assert @Test.respond_to?(:before)
    assert @Test.respond_to?(:after)
    assert @Test.respond_to?(:tests)
    assert @Test.respond_to?(:test)
    assert @Test.respond_to?(:assert)
  end

  test "callbacks data structure" do
    assert @Test.callbacks.is_a?(Hash)
    assert @Test.callbacks[:before].is_a?(Hash)
    assert @Test.callbacks[:after].is_a?(Hash)
  end

  test "callbacks" do
    a = lambda {}
    b = lambda {}
    c = lambda {}
    d = lambda {}
    @Test.before(:all, &a)
    @Test.before(:each, &b)
    @Test.after(:each, &c)
    @Test.after(:all, &d)
    assert @Test.callbacks[:before][:all].equal?(a)
    assert @Test.callbacks[:before][:each].equal?(b)
    assert @Test.callbacks[:after][:each].equal?(c)
    assert @Test.callbacks[:after][:all].equal?(d)
  end

  test "failure" do
    # Failing on purpose for the demo.
    # Use pry to check out the current binding.
    # For example, type @Test.
    assert false
  end

end
{'fraction_non_alphanumeric': 0.16139907290349767, 'fraction_numerical': 0.0, 'mean_word_length': 3.5741811175337186, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3902262', 'n_tokens_mistral': 842, 'n_tokens_neox': 844, 'n_words': 173}