<commit_before>require 'spec_helper'
require 'support/active_record'
require 'support/formats'
require 'json'

describe Travis::Notifications::Archive do
  include Support::Formats

  let(:since)    { Time.utc(2011, 1, 2) }
  let(:archiver) { Travis::Notifications::Archive.new }
  let(:build)    { Factory(:build, :created_at => Time.utc(2011, 1, 1), :config => { :rvm => ['1.9.2', 'rbx'] }) }

  describe 'archive' do
    before :each do
      archiver.stubs(:store).returns(true)
    end
<commit_msg>add another unit test for Notifications::Archive<commit_after>require 'spec_helper'
require 'support/active_record'
require 'support/formats'
require 'json'

describe Travis::Notifications::Archive do
  include Support::Formats

  let(:since)    { Time.utc(2011, 1, 2) }
  let(:archiver) { Travis::Notifications::Archive.new }
  let(:build)    { Factory(:build, :created_at => Time.utc(2011, 1, 1), :config => { :rvm => ['1.9.2', 'rbx'] }) }

  before do
    Travis.config.notifications = [:archive]
    Travis::Notifications::Pusher.send(:public, :queue_for, :payload_for)
  end

  it 'build:finish archives the build' do
    Travis::Notifications::Archive.any_instance.expects(:archive).with(build)
    Travis::Notifications.dispatch('build:finished', build)
  end

  describe 'archive' do
    before :each do
      archiver.stubs(:store).returns(true)
    end

{'fraction_non_alphanumeric': 0.15519765739385066, 'fraction_numerical': 0.021961932650073207, 'mean_word_length': 4.743697478991597, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '120301', 'n_tokens_mistral': 488, 'n_tokens_neox': 453, 'n_words': 97}