<commit_before>require 'spec_helper'

describe Heirloom::Catalog::Add do

  before do
    @regions     = ['us-west-1', 'us-west-2']
    @base        = 'base'
    @logger_stub = stub 'logger', :info => true
    @config_stub = stub 'config', :logger => @logger_stub
    @add = Heirloom::Catalog::Add.new :config => @config_stub,
                                      :name   => 'new_archive'
  end

  it "should call sdb to add the entry to the catalog" do
    @sdb_mock = mock 'sdb'
    Heirloom::AWS::SimpleDB.should_receive(:new).
                            with(:config => @config_stub).
                            and_return @sdb_mock
    @sdb_mock.should_receive(:put_attributes).
              with 'heirloom',
                   'heirloom_new_archive',
                   { "regions" => @regions,
                     "base"    => @base }
    @add.add_to_catalog :regions => @regions,
                        :base    => @base<commit_msg>removed unneeded curly braces<commit_after>require 'spec_helper'

describe Heirloom::Catalog::Add do

  before do
    @regions     = ['us-west-1', 'us-west-2']
    @base        = 'base'
    @logger_stub = stub 'logger', :info => true
    @config_stub = stub 'config', :logger => @logger_stub
    @add = Heirloom::Catalog::Add.new :config => @config_stub,
                                      :name   => 'new_archive'
  end

  it "should call sdb to add the entry to the catalog" do
    @sdb_mock = mock 'sdb'
    Heirloom::AWS::SimpleDB.should_receive(:new).
                            with(:config => @config_stub).
                            and_return @sdb_mock
    @sdb_mock.should_receive(:put_attributes).
              with 'heirloom',
                   'heirloom_new_archive',
                   "regions" => @regions, "base" => @base
    @add.add_to_catalog :regions => @regions,
                        :base    => @base
{'fraction_non_alphanumeric': 0.125531914893617, 'fraction_numerical': 0.002127659574468085, 'mean_word_length': 1.8243243243243243, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7187343', 'n_tokens_mistral': 598, 'n_tokens_neox': 571, 'n_words': 126}