<commit_before>require_relative "test_helper"
require "ostruct"

class TestEnumerable < Minitest::Test
  include TestGroupdate

  def test_enumerable
    user_a = create_user("2014-01-21")
    user_b = create_user("2014-03-14")
    expected = {
      utc.parse("2014-01-01") => [user_a],
      utc.parse("2014-02-01") => [],
      utc.parse("2014-03-01") => [user_b]
    }
    assert_equal expected, [user_a, user_b].group_by_month(&:created_at)
  end

  def test_no_block
    assert_raises(ArgumentError) { [].group_by_day(:created_at) }
  end

  def call_method(method, field, options)
    # p @users.group_by_period(method, options) { |u| u.send(field) }
    # p field
    Hash[@users.group_by_period(method, options) { |u| u.send(field) }.map { |k, v| [k, v.size] }]
  end<commit_msg>Removed commented code<commit_after>require_relative "test_helper"
require "ostruct"

class TestEnumerable < Minitest::Test
  include TestGroupdate

  def test_enumerable
    user_a = create_user("2014-01-21")
    user_b = create_user("2014-03-14")
    expected = {
      utc.parse("2014-01-01") => [user_a],
      utc.parse("2014-02-01") => [],
      utc.parse("2014-03-01") => [user_b]
    }
    assert_equal expected, [user_a, user_b].group_by_month(&:created_at)
  end

  def test_no_block
    assert_raises(ArgumentError) { [].group_by_day(:created_at) }
  end

  def call_method(method, field, options)
    Hash[@users.group_by_period(method, options) { |u| u.send(field) }.map { |k, v| [k, v.size] }]
  end
{'fraction_non_alphanumeric': 0.15456362425049966, 'fraction_numerical': 0.05329780146568954, 'mean_word_length': 3.8766233766233764, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '7452044', 'n_tokens_mistral': 623, 'n_tokens_neox': 564, 'n_words': 98}