<commit_before>
# require 'test_helper'

class SchedulerTest < ActiveSupport::TestCase

  test "require class" do
    require "modules/scheduler"
    assert Object.const_defined? :Scheduler
  end

  test "has default driver" do
    assert Scheduler.driver
    assert (Scheduler.driver == Scheduling::Resque)
  end

  test "schedule a job" do
    Resque.reset_delayed_queue
    Scheduler.new.schedule_at((Time.new+30), Scheduling::Job.new("foobar", {}))
    assert (Resque.redis.zcard("delayed_queue_schedule") == 1) # key is namespaced
  end

  test "must override methods" do<commit_msg>use methods instead of spec blocks<commit_after>
# require 'test_helper'

class SchedulerTest < ActiveSupport::TestCase

  def test_require_class
    require "modules/scheduler"
    assert Object.const_defined? :Scheduler
  end

  def test_has_default_driver
    assert Scheduler.driver
    assert Scheduler.driver == Scheduling::Resque
  end

  def test_schedule_a_job
    Resque.reset_delayed_queue
    Scheduler.new.schedule_at((Time.new+30), Scheduling::Job.new("foobar", {}))
    assert Resque.redis.zcard("delayed_queue_schedule") == 1 # key is namespaced
  end

  def test_driver_must_override_methods
{'fraction_non_alphanumeric': 0.09364548494983277, 'fraction_numerical': 0.005016722408026756, 'mean_word_length': 4.567441860465117, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7547530', 'n_tokens_mistral': 391, 'n_tokens_neox': 370, 'n_words': 87}