<commit_before>require 'bundler/setup'
require 'kintama'
require 'ezmq'
require 'robot_sweatshop/config'
require 'robot_sweatshop/connections'
require_relative 'shared/scaffolding'
require_relative 'shared/helpers'
$stdout.sync = true

Kintama.on_start do
  Setup.empty_conveyor
  @pids = Processes.start %w(worker)
  @conveyor_thread = Setup.stub 'Server', port: configatron.conveyor_port
end

Kintama.on_finish do
  Processes.stop @pids
  @conveyor_thread.kill
end

describe 'the Worker' do
  include InputHelper
  using ExtendedEZMQ

  setup do
    @pusher = EZMQ::Pusher.new port: configatron.worker_port
    @pusher.serialize_with_json!
    clear_worker_output
    clear_stub_output
  end

  teardown do
    @client.close
  end
<commit_msg>Fixed a bug in the Worker spec<commit_after>require 'bundler/setup'
require 'kintama'
require 'ezmq'
require 'robot_sweatshop/config'
require 'robot_sweatshop/connections'
require_relative 'shared/scaffolding'
require_relative 'shared/helpers'
$stdout.sync = true

Kintama.on_start do
  Setup.empty_conveyor
  @pids = Processes.start %w(worker)
  @conveyor_thread = Setup.stub 'Server', port: configatron.conveyor_port
end

Kintama.on_finish do
  Processes.stop @pids
  @conveyor_thread.kill
end

describe 'the Worker' do
  include InputHelper
  using ExtendedEZMQ

  setup do
    @pusher = EZMQ::Pusher.new port: configatron.worker_port
    @pusher.serialize_with_json!
    clear_worker_output
    clear_stub_output
  end

  teardown do
    @pusher.close
  end

{'fraction_non_alphanumeric': 0.07962840079628401, 'fraction_numerical': 0.0, 'mean_word_length': 4.867704280155642, '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': '4184872', 'n_tokens_mistral': 557, 'n_tokens_neox': 551, 'n_words': 118}