<commit_before>require 'spec_helper'

module Cucumber
  describe Constantize do
    include Constantize

    it "loads html formatter" do
      clazz = constantize('Cucumber::Formatter::Html')
      clazz.name.should == 'Cucumber::Formatter::Html'
    end

    it "fails to load a made up class" do
      expect { constantize('My::MadeUp::ClassName') }.to raise_error(LoadError)
    end
  end
end<commit_msg>Added a failing test that checks if an existing module (or class) exists with a name, that constantize will use the full namespace<commit_after>require 'spec_helper'

module Cucumber
  describe Constantize do
    include Constantize

    it "loads html formatter" do
      clazz = constantize('Cucumber::Formatter::Html')
      clazz.name.should == 'Cucumber::Formatter::Html'
    end

    it "loads progerss formatter when a class exists" do
      module ::Html end
      clazz = constantize('Cucumber::Formatter::Html')
      clazz.name.should == 'Cucumber::Formatter::Html'
    end

    it "fails to load a made up class" do
      expect { constantize('My::MadeUp::ClassName') }.to raise_error(LoadError)
    end
  end
end
{'fraction_non_alphanumeric': 0.09532215357458076, 'fraction_numerical': 0.0, 'mean_word_length': 3.7053941908713695, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3083567', 'n_tokens_mistral': 341, 'n_tokens_neox': 336, 'n_words': 108}