<commit_before>require 'securerandom'
require 'open3'
require 'aws-sdk-core'

def run_puppet(code)
  run = code.strip.gsub("\n", '')
  `puppet apply -e "#{run}" --test --modulepath ../`
end

describe "ec2_instance" do

  before(:all) do

    seed = SecureRandom.uuid
    @name = "#{seed}-instance"
    @type = 't1.micro'
    @region = 'sa-east-1'
    @ami = 'ami-41e85d5c'

    code_under_test = <<-EOS
      ec2_instance { '#{@name}':
        ensure => present,
        region => '#{@region}',
        image_id => '#{@ami}',<commit_msg>run puppet under bundler, to allow easier matrix builds<commit_after>require 'securerandom'
require 'open3'
require 'aws-sdk-core'

def run_puppet(code)
  run = code.strip.gsub("\n", '')
  `bundle exec puppet apply -e "#{run}" --test --modulepath ../`
end

describe "ec2_instance" do

  before(:all) do

    seed = SecureRandom.uuid
    @name = "#{seed}-instance"
    @type = 't1.micro'
    @region = 'sa-east-1'
    @ami = 'ami-41e85d5c'

    code_under_test = <<-EOS
      ec2_instance { '#{@name}':
        ensure => present,
        region => '#{@region}',
        image_id => '#{@ami}',
{'fraction_non_alphanumeric': 0.18351063829787234, 'fraction_numerical': 0.01773049645390071, 'mean_word_length': 2.906574394463668, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2625514', 'n_tokens_mistral': 435, 'n_tokens_neox': 416, 'n_words': 93}