<commit_before>require "test_helper"

class Hydrogen::GeneratorsTest < MiniTest::Unit::TestCase
  def invoke(*args)
    Hydrogen::Generators.invoke *args
  end

  def test_generator_lookup_against_full_name
    generator = Class.new Hydrogen::Generator do
      def self.full_generator_name
        "foo"
      end
    end

    generator.expects(:start).returns(:invoked)

    result = invoke "foo"
    assert_equal :invoked, result
  end

  def test_generator_lookup_against_name_and_namespace
    generator = Class.new Hydrogen::Generator do
      namespace :ember

      def self.generator_name
        "foo"
      end
    end

    generator.expects(:start).returns(:invoked)

    result = invoke "ember:foo"
    assert_equal :invoked, result
  end

  def test_generator_namespace_can_be_nested
    generator = Class.new Hydrogen::Generator do
      namespace "ember:test"

      def self.generator_name
        "model"
      end
    end

    generator.expects(:start).returns(:invoked)

    result = invoke "ember:test:model"
    assert_equal :invoked, result
  end
end
<commit_msg>Remove tests for wrong object<commit_after>require "test_helper"

class Hydrogen::GeneratorsTest < MiniTest::Unit::TestCase
  def invoke(*args)
    Hydrogen::Generators.invoke *args
  end

  def teardown
    Hydrogen::Generators.subclasses.clear
  end

  def test_generator_lookup_against_full_name
    generator = Class.new do
      def self.full_generator_name
        "foo"
      end
    end

    Hydrogen::Generators.subclasses << generator

    generator.expects(:start).returns(:invoked)

    result = invoke "foo"
    assert_equal :invoked, result
  end
end

{'fraction_non_alphanumeric': 0.07995154451847365, 'fraction_numerical': 0.0, 'mean_word_length': 3.3703703703703702, 'pattern_counts': {'":': 0, '<': 7, '<?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': '4704386', 'n_tokens_mistral': 515, 'n_tokens_neox': 486, 'n_words': 111}