<commit_before>require "spec_helper"
require_relative 'aws_ec2_list/ec2_double'
require_relative 'aws_ec2_list/io_double'

describe AwsEc2List do
  let(:stdout) { AwsEc2List::IODouble.new }
  let(:ec2) { AwsEc2List::Ec2Double }
  let(:region) { 'us-west-1' }

  def output
    """PROJECT | STACK NAME        | PUBLIC DNS NAME | LAUNCH TIME | APP VERSION | STATE
webapp  | lp-webapp-prod-01 | public_dns_name | launch_time | 123h12kj    | state"""
  end

  it "has a version number" do
    expect(AwsEc2List::VERSION).not_to be nil
  end

  it "returns the instances" do
    AwsEc2List.call(ec2: ec2, region: region, stdout: stdout)
    expect(stdout.to_s).to eq output<commit_msg>fix broken test<commit_after>require "spec_helper"
require_relative 'aws_ec2_list/ec2_double'
require_relative 'aws_ec2_list/io_double'

describe AwsEc2List do
  let(:stdout) { AwsEc2List::IODouble.new }
  let(:ec2) { AwsEc2List::Ec2Double }
  let(:region) { 'us-west-1' }

  def output
    """project | stack_name        | public_dns_name | launch_time | app_version | state
webapp  | lp-webapp-prod-01 | public_dns_name | launch_time | 123h12kj    | state"""
  end

  it "has a version number" do
    expect(AwsEc2List::VERSION).not_to be nil
  end

  it "returns the instances" do
    AwsEc2List.call(ec2: ec2, region: region, stdout: stdout)
    expect(stdout.to_s).to eq output
{'fraction_non_alphanumeric': 0.11013215859030837, 'fraction_numerical': 0.02936857562408223, 'mean_word_length': 4.162878787878788, 'pattern_counts': {'":': 0, '<': 3, '<?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': '208488', 'n_tokens_mistral': 545, 'n_tokens_neox': 506, 'n_words': 114}