<commit_before>require "test_helper"

describe Copyrighter::Helpers do
  it "should return the current year by default" do
    assert_equal Time.now.year.to_s, Class.new.extend(Copyrighter::Helpers).copyright
  end

  it "should return just the current year if it is the argument" do
    year = Time.now.year
    assert_equal year.to_s, Class.new.extend(Copyrighter::Helpers).copyright(year)
  end

  it "should return a range up to the current year for a previous year argument" do
    year = 2000
    now = Time.now.year
    assert_equal [year, " – ", now].join, Class.new.extend(Copyrighter::Helpers).copyright(year)
  end

  it "should return a range up to the current year for a previous year argument with a custom separator" do
    year = 2000
    now = Time.now.year
    sep = "to"
    assert_equal [year, sep, now].join, Class.new.extend(Copyrighter::Helpers).copyright(year, sep)<commit_msg>Improve test coverage for Ranges<commit_after>require "test_helper"

describe Copyrighter::Helpers do
  it "should return the current year by default" do
    assert_equal Time.now.year.to_s, Class.new.extend(Copyrighter::Helpers).copyright
  end

  it "should return just the current year if it is the argument" do
    year = Time.now.year
    assert_equal year.to_s, Class.new.extend(Copyrighter::Helpers).copyright(year)
  end

  it "should return a range up to the current year for a previous year argument" do
    year = 2000
    now = Time.now.year
    assert_equal [year, " – ", now].join, Class.new.extend(Copyrighter::Helpers).copyright(year)
  end

  it "should return a range when using a Range argument" do
    first = 2000
    last = 2010
    assert_equal [first, " – ", last].join, Class.new.extend(Copyrighter::Helpers).copyright(first..last)
  end

  it "should return a range up to the current year for a previous year argument with a custom separator" do
    year = 2000
    now = Time.now.year
    sep = "to"
    assert_equal [year, sep, now].join, Class.new.extend(Copyrighter::Helpers).copyright(year, sep)
{'fraction_non_alphanumeric': 0.0957079427725703, 'fraction_numerical': 0.011840157868771583, 'mean_word_length': 3.817102137767221, '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': '4486712', 'n_tokens_mistral': 640, 'n_tokens_neox': 613, 'n_words': 214}