<commit_before>require 'spec_helper'

describe Runner do
  let (:kls) { mock_app_class {} }

  before do
    handler = begin
                Rack::Handler::Thin
              rescue LoadError
                Rack::Handler::WEBrick
              end
    handler.stub :run
  end

  it 'should include the default middleware on top' do
    kls.run!
    kls.middlewares.first.should == Rack::ShowExceptions
    kls.middlewares[1].should == Rack::CommonLogger
  end

  it 'should support before run hooks' do
    prc = Proc.new { 'foo' }
    kls.before_run &prc
    kls.should_receive(:instance_eval).with(&prc)
    kls.run!
  end
end<commit_msg>Shorten the spec<commit_after>require 'spec_helper'

describe Runner do
  let (:kls) { mock_app_class {} }

  before do
    kls.optimal_runner.stub :run
  end

  it 'should include the default middleware on top' do
    kls.run!
    kls.middlewares.first.should == Rack::ShowExceptions
    kls.middlewares[1].should == Rack::CommonLogger
  end

  it 'should support before run hooks' do
    prc = Proc.new { 'foo' }
    kls.before_run &prc
    kls.should_receive(:instance_eval).with(&prc)
    kls.run!
  end
end
{'fraction_non_alphanumeric': 0.10069444444444445, 'fraction_numerical': 0.001736111111111111, 'mean_word_length': 2.8178807947019866, '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': '2182342', 'n_tokens_mistral': 408, 'n_tokens_neox': 393, 'n_words': 96}