<commit_before>
require 'test_helper'

class HTML::Pipeline::RequireHelperTest < Minitest::Test
  def test_works_with_existing
    HTML::Pipeline.require_dependency('rake', 'SomeClass')
  end

  def test_raises_mising_dependency_error
    assert_raises HTML::Pipeline::MissingDependencyError do
      HTML::Pipeline.require_dependency('non-existant', 'SomeClass')
    end
  end

  def test_raises_error_including_message
    error = assert_raises(LoadError) do
      HTML::Pipeline.require_dependency('non-existant', 'SomeClass')
    end
    assert_includes(error.message, "Missing dependency 'non-existant' for SomeClass. See README.md for details.")
  end

  def test_raises_error_includes_underlying_message
    error = assert_raises LoadError do
      HTML::Pipeline.require_dependency('non-existant', 'SomeClass')
    end
    assert_includes(error.message, 'LoadError: cannot load such file')
  end
end<commit_msg>Swap these error names<commit_after>
require 'test_helper'

class HTML::Pipeline::RequireHelperTest < Minitest::Test
  def test_works_with_existing
    HTML::Pipeline.require_dependency('rake', 'SomeClass')
  end

  def test_raises_mising_dependency_error
    assert_raises HTML::Pipeline::MissingDependencyError do
      HTML::Pipeline.require_dependency('non-existant', 'SomeClass')
    end
  end

  def test_raises_error_including_message
    error = assert_raises(MissingDependencyError) do
      HTML::Pipeline.require_dependency('non-existant', 'SomeClass')
    end
    assert_includes(error.message, "Missing dependency 'non-existant' for SomeClass. See README.md for details.")
  end

  def test_raises_error_includes_underlying_message
    error = assert_raises MissingDependencyError do
      HTML::Pipeline.require_dependency('non-existant', 'SomeClass')
    end
    assert_includes(error.message, 'LoadError: cannot load such file')
  end
end
{'fraction_non_alphanumeric': 0.08756006406833956, 'fraction_numerical': 0.0, 'mean_word_length': 5.374149659863946, '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': '1202670', 'n_tokens_mistral': 560, 'n_tokens_neox': 542, 'n_words': 116}