<commit_before># frozen_string_literal: true
require "spec_helper"

describe Bundler::Fetcher::CompactIndex do
  let(:downloader)  { double(:downloader) }
  let(:remote)      { double(:remote, :cache_slug => "lsjdf") }
  let(:display_uri) { URI("http://sample_uri.com") }
  let(:compact_index) { described_class.new(downloader, remote, display_uri) }

  # Testing private method. Do not commit.
  describe "#specs_for_names" do
    it "has only one thread open at the end of the run" do
      compact_index.specs_for_names(["lskdjf"])

      thread_count = Thread.list.select {|thread| thread.status == "run" }.count
      expect(thread_count).to eq 1
    end

    it "calls worker#stop during the run" do
      expect_any_instance_of(Bundler::Worker).to receive(:stop).at_least(:once)
<commit_msg>Fix issue with older versions of Ruby and URI.<commit_after># frozen_string_literal: true
require "spec_helper"

describe Bundler::Fetcher::CompactIndex do
  let(:downloader)  { double(:downloader) }
  let(:remote)      { double(:remote, :cache_slug => "lsjdf") }
  let(:display_uri) { URI("http://sampleuri.com") }
  let(:compact_index) { described_class.new(downloader, remote, display_uri) }

  # Testing private method. Do not commit.
  describe "#specs_for_names" do
    it "has only one thread open at the end of the run" do
      compact_index.specs_for_names(["lskdjf"])

      thread_count = Thread.list.select {|thread| thread.status == "run" }.count
      expect(thread_count).to eq 1
    end

    it "calls worker#stop during the run" do
      expect_any_instance_of(Bundler::Worker).to receive(:stop).at_least(:once)

{'fraction_non_alphanumeric': 0.12592137592137592, 'fraction_numerical': 0.0012285012285012285, 'mean_word_length': 4.394039735099338, '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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5515098', 'n_tokens_mistral': 542, 'n_tokens_neox': 529, 'n_words': 132}