<commit_before>require File.expand_path("../helper.rb", __FILE__)

context "Queue" do

  setup { @database = init_db }

  test "Queue class responds to enqueue" do
    QC::Queue.enqueue("Klass.method")
  end

  test "Queue class has a default table name" do
    QC::Queue.enqueue("Klass.method")
  end

  test "Queue class responds to dequeue" do
    QC::Queue.enqueue("Klass.method")
    assert_equal "Klass.method", QC::Queue.dequeue.signature
  end

  test "Queue class responds to delete" do
    QC::Queue.enqueue("Klass.method")
    job = QC::Queue.dequeue
    QC::Queue.delete(job)
  end

  test "Queue class responds to delete_all" do
    2.times { QC::Queue.enqueue("Klass.method") }
    job1,job2 = QC::Queue.dequeue, QC::Queue.dequeue
    QC::Queue.delete_all
  end

  test "Queue class return the length of the queue" do
    2.times { QC::Queue.enqueue("Klass.method") }<commit_msg>Add Queue test for defaut table name<commit_after>require File.expand_path("../helper.rb", __FILE__)

context "Queue" do

  setup { @database = init_db }

  test "Queue class responds to enqueue" do
    QC::Queue.enqueue("Klass.method")
  end

  test "Queue class has a default table name" do
    default_table_name = QC::Database.new.table_name
    assert_equal default_table_name, QC::Queue.database.table_name
  end

  test "Queue class responds to dequeue" do
    QC::Queue.enqueue("Klass.method")
    assert_equal "Klass.method", QC::Queue.dequeue.signature
  end

  test "Queue class responds to delete" do
    QC::Queue.enqueue("Klass.method")
    job = QC::Queue.dequeue
    QC::Queue.delete(job)
  end

  test "Queue class responds to delete_all" do
    2.times { QC::Queue.enqueue("Klass.method") }
    job1,job2 = QC::Queue.dequeue, QC::Queue.dequeue
    QC::Queue.delete_all
  end

  test "Queue class return the length of the queue" do
    2.times { QC::Queue.enqueue("Klass.method") }
{'fraction_non_alphanumeric': 0.12162876784769963, 'fraction_numerical': 0.004230565838180857, 'mean_word_length': 3.7537688442211055, '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': '5173172', 'n_tokens_mistral': 667, 'n_tokens_neox': 619, 'n_words': 168}