<commit_before>require 'rails_helper'
require 'metric_collector'

describe MetricCollector::Native::MetricFu::Collector, :type => :model do
  subject{ MetricCollector::Native::MetricFu::Collector.new }

  describe 'collect_metrics' do
    let(:code_directory) { Dir.pwd }
    let(:wanted_metrics) { {} }
    let(:path) { "" }
    let(:runner) { mock('metric_fu_runner') }
    let(:processing) { FactoryGirl.build(:processing) }

    it 'is expected to run the collector and parse the results' do
      MetricCollector::Native::MetricFu::Runner.expects(:new).with(repository_path: code_directory).returns(runner)
      runner.expects(:run)
      runner.expects(:yaml_path).returns(path)
      MetricCollector::Native::MetricFu::Parser.expects(:parse_all).with(path, wanted_metrics, processing)
      runner.expects(:clean_output)
      subject.collect_metrics(code_directory, wanted_metrics, processing)
    end
  end
<commit_msg>Add whitespace between words<commit_after>require 'rails_helper'
require 'metric_collector'

describe MetricCollector::Native::MetricFu::Collector, :type => :model do
  subject { MetricCollector::Native::MetricFu::Collector.new }

  describe 'collect_metrics' do
    let(:code_directory) { Dir.pwd }
    let(:wanted_metrics) { {} }
    let(:path) { "" }
    let(:runner) { mock('metric_fu_runner') }
    let(:processing) { FactoryGirl.build(:processing) }

    it 'is expected to run the collector and parse the results' do
      MetricCollector::Native::MetricFu::Runner.expects(:new).with(repository_path: code_directory).returns(runner)
      runner.expects(:run)
      runner.expects(:yaml_path).returns(path)
      MetricCollector::Native::MetricFu::Parser.expects(:parse_all).with(path, wanted_metrics, processing)
      runner.expects(:clean_output)
      subject.collect_metrics(code_directory, wanted_metrics, processing)
    end
  end

{'fraction_non_alphanumeric': 0.12913553895410887, 'fraction_numerical': 0.0, 'mean_word_length': 5.270903010033445, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6887411', 'n_tokens_mistral': 581, 'n_tokens_neox': 554, 'n_words': 97}