<commit_before>require_relative 'test_case'
require 'rtest/runnable'

module Rtest
  class RunnableTest < TestCase
    def test_runnable_methods_is_a_subclass_responsibility
      e = assert_raises NotImplementedError do
        Runnable.runnable_methods
      end

      exp = "subclass responsibility"
      assert_equal exp, e.message
    end

    def test_runnables_list_all_runnables_that_inherit_from_runnable
      assert_includes Runnable.runnables, PassingTest
    end

    def test_runnables_can_be_overridden
      prev_runnables = Runnable.runnables

      Runnable.runnables = "omg"
      assert_includes Runnable.runnables, "omg"

      # reset Runnable.runnables to avoid misshaps, teardown didn't pull through
      Runnable.runnables = prev_runnables
    end
<commit_msg>Add ensure block to test to actually ensure<commit_after>require_relative 'test_case'
require 'rtest/runnable'

module Rtest
  class RunnableTest < TestCase
    def test_runnable_methods_is_a_subclass_responsibility
      e = assert_raises NotImplementedError do
        Runnable.runnable_methods
      end

      exp = "subclass responsibility"
      assert_equal exp, e.message
    end

    def test_runnables_list_all_runnables_that_inherit_from_runnable
      assert_includes Runnable.runnables, PassingTest
    end

    def test_runnables_can_be_overridden
      prev_runnables = Runnable.runnables

      Runnable.runnables = "omg"
      assert_includes Runnable.runnables, "omg"

      # reset Runnable.runnables to avoid mishaps, teardown didn't pull through
    ensure
      Runnable.runnables = prev_runnables
    end

{'fraction_non_alphanumeric': 0.04207920792079208, 'fraction_numerical': 0.0, 'mean_word_length': 3.6599423631123917, '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': '940858', 'n_tokens_mistral': 543, 'n_tokens_neox': 504, 'n_words': 110}