<commit_before>require_relative "spec_helper"

module Nyara
  describe 'evented IO' do
    before :all do
      GC.stress = false
      pid = Process.pid
      @server = fork do
        exec 'ruby', __dir__ + '/apps/connect.rb'
      end
      sleep 1.5 # wait for server startup
    end

    after :all do
      Process.kill :KILL, @server
    end

    it "works" do
      GC.stress = false # open-uri creates too many objects!
      result1 = open "http://localhost:3003", &:read<commit_msg>sleep longer for travis-ci...<commit_after>require_relative "spec_helper"

module Nyara
  describe 'evented IO' do
    before :all do
      pid = Process.pid
      @server = fork do
        exec 'ruby', __dir__ + '/apps/connect.rb'
      end
      GC.stress = false
      sleep 1.8 # wait for server startup
    end

    after :all do
      Process.kill :KILL, @server
    end

    it "works" do
      GC.stress = false # open-uri creates too many objects!
      result1 = open "http://localhost:3003", &:read
{'fraction_non_alphanumeric': 0.09780439121756487, 'fraction_numerical': 0.013972055888223553, 'mean_word_length': 2.2564935064935066, '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': '2324220', 'n_tokens_mistral': 326, 'n_tokens_neox': 309, 'n_words': 104}