<commit_before>require_relative '../../ohm_helper.rb'
require File.expand_path('../../../../app/classes/map_reduce.rb', __FILE__)
require File.expand_path('../../../../app/classes/map_reduce/topic_authority.rb', __FILE__)
require_relative '../../../app/ohm-models/authority.rb'

describe MapReduce::TopicAuthority do
  let(:gu1) {GraphUser.create}
  let(:gu2) {GraphUser.create}

  before do
    unless defined?(GraphUser)
      class GraphUser < OurOhm; end
    end
    unless defined?(Channel)
      class Channel < OurOhm;
        attribute :title
        reference :created_by, GraphUser
      end
    end
  end

  describe :wrapped_map do
     it do
       ch1 = Channel.create(title: "Ruby", created_by: gu1)
       ch2 = Channel.create(title: "Ruby", created_by: gu2)
       ch3 = Channel.create(title: "Java", created_by: gu1)
       channels = [ch1,ch2,ch3]<commit_msg>made this test use spec_helper<commit_after>#require_relative '../../ohm_helper.rb'
#require File.expand_path('../../../../app/classes/map_reduce.rb', __FILE__)
#require File.expand_path('../../../../app/classes/map_reduce/topic_authority.rb', __FILE__)
#require_relative '../../../app/ohm-models/authority.rb'

require 'spec_helper'

describe MapReduce::TopicAuthority do
  let(:gu1) {GraphUser.create}
  let(:gu2) {GraphUser.create}

  before do
    unless defined?(GraphUser)
      class GraphUser < OurOhm; end
    end
    unless defined?(Channel)
      class Channel < OurOhm;
        attribute :title
        reference :created_by, GraphUser
      end
    end
  end

  describe :wrapped_map do
     it do
       ch1 = Channel.create(title: "Ruby", created_by: gu1)
       ch2 = Channel.create(title: "Ruby", created_by: gu2)
       ch3 = Channel.create(title: "Java", created_by: gu1)
       channels = [ch1,ch2,ch3]
{'fraction_non_alphanumeric': 0.14777777777777779, 'fraction_numerical': 0.012222222222222223, 'mean_word_length': 3.0200892857142856, 'pattern_counts': {'":': 0, '<': 7, '<?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': '4550102', 'n_tokens_mistral': 594, 'n_tokens_neox': 587, 'n_words': 127}