<commit_before><commit_msg>Adds aws spec<commit_after>require 'spec_helper'

describe Alephant::Harness::AWS do

  describe ".configure" do

    it "Configures the AWS global config based on environment variables" do
      environment = {
        'AWS_S3_ENDPOINT'         => 'localhost',
        'AWS_S3_PORT'             => '4569',
        'AWS_SQS_ENDPOINT'        => 'localhost',
        'AWS_SQS_PORT'            => '4568',
        'AWS_DYNAMO_DB_ENDPOINT'  => 'localhost',
        'AWS_DYNAMO_DB_PORT'      => '4570',
        'AWS_USE_SSL'             => 'false',
        'AWS_S3_FORCE_PATH_STYLE' => 'true',
        'AWS_ACCESS_KEY_ID'       => 'access',
        'AWS_SECRET_ACCESS_KEY'   => 'secret'
      }

      Alephant::Harness::AWS.configure(environment)

      environment.each do |key, value|
        key = key[/AWS_(.*)/,1].downcase.to_sym
        config_value = AWS.config.send(key.to_sym)
        expect(config_value).to eq(value)
      end

    end

    it "Sanitises boolean values" do
      environment = {
        'AWS_USE_SSL'             => 'false',
        'AWS_S3_FORCE_PATH_STYLE' => 'true'
      }

      Alephant::Harness::AWS.configure(environment)

      expect(AWS.config.use_ssl).to be_falsy
      expect(AWS.config.s3_force_path_style).to be_truthy
    end

  end
end



{'fraction_non_alphanumeric': 0.1210727969348659, 'fraction_numerical': 0.013793103448275862, 'mean_word_length': 2.256857855361596, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '1306410', 'n_tokens_mistral': 478, 'n_tokens_neox': 453, 'n_words': 73}