<commit_before>require 'spec_helper'

class TestConsumer < Chore::Consumer
  def initialize(queue_name, opts={})
  end

  def consume
    # just something that looks like an SQS message
    msg = OpenStruct.new( :id => 1, :body => "test" )
    yield msg if block_given?
  end
end

class NoQueueConsumer < Chore::Consumer
  def initialize(queue_name, opts={})
    raise AWS::SQS::Errors::NonExistentQueue
  end

  def consume
  end
end

describe Chore::Strategy::ThreadedConsumerStrategy do
  let(:fetcher) { double("fetcher") }
  let(:manager) { double("manager") }
  let(:consumer) { TestConsumer }
  let(:strategy) { Chore::Strategy::ThreadedConsumerStrategy.new(fetcher) }
<commit_msg>actually raise the right exception<commit_after>require 'spec_helper'

class TestConsumer < Chore::Consumer
  def initialize(queue_name, opts={})
  end

  def consume
    # just something that looks like an SQS message
    msg = OpenStruct.new( :id => 1, :body => "test" )
    yield msg if block_given?
  end
end

class NoQueueConsumer < Chore::Consumer
  def initialize(queue_name, opts={})
    raise Chore::TerribleMistake
  end

  def consume
  end
end

describe Chore::Strategy::ThreadedConsumerStrategy do
  let(:fetcher) { double("fetcher") }
  let(:manager) { double("manager") }
  let(:consumer) { TestConsumer }
  let(:strategy) { Chore::Strategy::ThreadedConsumerStrategy.new(fetcher) }

{'fraction_non_alphanumeric': 0.11696750902527075, 'fraction_numerical': 0.001444043321299639, 'mean_word_length': 4.799163179916318, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '970808', 'n_tokens_mistral': 445, 'n_tokens_neox': 427, 'n_words': 114}