<commit_before>module Excon
  describe Rails do
    before do
      stub_request(:any, 'example.com').to_return(body: 'OK')
    end

    after do
      if Rails::Railtie.instance.send(:instance_variable_defined?, :@ran)
        Rails::Railtie.instance.send(:remove_instance_variable, :@ran)
      end
    end

    it 'registers Excon middleware' do
      middlewares = ::Excon.defaults[:middlewares]
      expect(middlewares).to include(Excon::Rails::Middleware)
    end

    it 'initializes a Railtie' do
      expect(Excon::Rails::Railtie.superclass).to eq(::Rails::Railtie)
    end

    it 'logs runtimes' do
      stub_request(:any, 'example.com').to_return(body: 'OK')
      Rails::Railtie.run_initializers
      Excon.get('http://example.com')
      expect(Rails::LogSubscriber.runtime).to be > 0
    end

    it 'logs requests to logger' do
      @logger.level = Logger::DEBUG
      Rails::Railtie.run_initializers
      Excon.get('http://example.com')
      expect(@logger.logged(:debug)[0])
        .to match(%r{Excon Request \(\d\.\d+ms\)  GET http://example\.com/})
    end
  end
end<commit_msg>Relax spec expectation for request length<commit_after>module Excon
  describe Rails do
    before do
      stub_request(:any, 'example.com').to_return(body: 'OK')
    end

    after do
      if Rails::Railtie.instance.send(:instance_variable_defined?, :@ran)
        Rails::Railtie.instance.send(:remove_instance_variable, :@ran)
      end
    end

    it 'registers Excon middleware' do
      middlewares = ::Excon.defaults[:middlewares]
      expect(middlewares).to include(Excon::Rails::Middleware)
    end

    it 'initializes a Railtie' do
      expect(Excon::Rails::Railtie.superclass).to eq(::Rails::Railtie)
    end

    it 'logs runtimes' do
      stub_request(:any, 'example.com').to_return(body: 'OK')
      Rails::Railtie.run_initializers
      Excon.get('http://example.com')
      expect(Rails::LogSubscriber.runtime).to be > 0
    end

    it 'logs requests to logger' do
      @logger.level = Logger::DEBUG
      Rails::Railtie.run_initializers
      Excon.get('http://example.com')
      expect(@logger.logged(:debug)[0])
        .to match(%r{Excon Request \(\d+\.\d+ms\)  GET http://example\.com/})
    end
  end
end
{'fraction_non_alphanumeric': 0.13788487282463185, 'fraction_numerical': 0.00178491744756805, 'mean_word_length': 3.1213235294117645, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1518360', 'n_tokens_mistral': 773, 'n_tokens_neox': 732, 'n_words': 146}