<commit_before>require 'spec_helper'

describe Konacha::Runner do
  before do
    Konacha.mode = :runner
    Konacha.config.driver = :selenium_with_firebug
    STDOUT.stub(:puts)
  end

  describe "#run" do
    let(:suite) do
      {'event' => 'suite',
       'type' => 'suite',
       'data' => {
         'title' => 'failure',
         'fullTitle' => 'failure'
       }}
    end
<commit_msg>Add a spec for FORMAT environment variable<commit_after>require 'spec_helper'

describe Konacha::Runner do
  before do
    Konacha.mode = :runner
    STDOUT.stub(:puts)
  end

  describe ".new" do
    before do
      class TestFormatter
        def initialize(io)
        end
      end
      ENV['FORMAT'] = 'Konacha::Formatter,TestFormatter'
    end

    after do
      Object.send(:remove_const, :TestFormatter)
      ENV.delete('FORMAT')
    end

    it "initializes a reporter with formatters named by the FORMAT environment variable" do
      Konacha::Reporter.should_receive(:new).with(instance_of(Konacha::Formatter), instance_of(TestFormatter))
      described_class.new
    end
  end

  describe "#run" do
    let(:suite) do
      {'event' => 'suite',
       'type' => 'suite',
       'data' => {
         'title' => 'failure',
         'fullTitle' => 'failure'
       }}
    end

{'fraction_non_alphanumeric': 0.12402496099843993, 'fraction_numerical': 0.0, 'mean_word_length': 2.563888888888889, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '3175716', 'n_tokens_mistral': 416, 'n_tokens_neox': 400, 'n_words': 98}