<commit_before>require 'spec_helper'
require 'rake'

# load rakefile and run task to create executable files
load File.open('Rakefile')
Rake::Task['render_executables'].invoke

SCENARIOS_TO_SKIP = ['account_add_card', 'account_create_buyer', 'account_create_merchant',
'bank_account_delete', 'bank_account_verification_create', 'card_update',
 'credit_create_existing_bank_account', 'debit_refund','hold_capture','refund_create',
 'event_list', 'customer_create_hold', 'debit_create', 'bank_account_find_and_create', 'customer_add_card',
'customer_create_debit', 'customer_add_bank_account', 'bank_account_find_and_delete', 'bank_account_find_and_credit']

parsed_data = JSON.parse(File.read('./scenario.cache'))

# list all directories in scenarios directory

subdir_list = Dir["./scenarios/*"].reject { |o| not File.directory?(o) }
subdir_list.reject! { |item| SCENARIOS_TO_SKIP.include?(item.split("/").last) }

describe "Scenarios", :vcr do
  subdir_list.each do |scenario|
    next unless File.exist?("#{scenario}/executable.rb")
    response = nil
    describe "#{scenario.split("/").last}", :vcr do
      before do
        file = File.read("#{scenario}/executable.rb")
        begin
          response = eval(file) # evaluate file to make sure it's a valid Ruby file
        rescue
          puts "#{scenario.split("/").last}'s executable raised an error"
        end
      end
      it "#{scenario.split("/").last}" do
        response.should_not be_nil
      end
    end
  end
end
<commit_msg>travis ruby environment..<commit_after>require 'spec_helper'
require 'rake'

# load rakefile and run task to create executable files
load File.open('Rakefile')
Rake::Task['render_executables'].invoke

SCENARIOS_TO_SKIP = ['account_add_card', 'account_create_buyer', 'account_create_merchant',
'bank_account_delete', 'bank_account_verification_create', 'card_update',
 'credit_create_existing_bank_account', 'debit_refund','hold_capture','refund_create',
 'event_list', 'customer_create_hold', 'debit_create', 'bank_account_find_and_create', 'customer_add_card',
'customer_create_debit', 'customer_add_bank_account', 'bank_account_find_and_delete', 'bank_account_find_and_credit',
'account_capture_hold', 'bank_account_invalid_routing_number', 'account_create_debit']

parsed_data = JSON.parse(File.read('./scenario.cache'))

# list all directories in scenarios directory

subdir_list = Dir["./scenarios/*"].reject { |o| not File.directory?(o) }
subdir_list.reject! { |item| SCENARIOS_TO_SKIP.include?(item.split("/").last) }

describe "Scenarios", :vcr do
  subdir_list.each do |scenario|
    next unless File.exist?("#{scenario}/executable.rb")
    response = nil
    describe "#{scenario.split("/").last}", :vcr do
      before do
        file = File.read("#{scenario}/executable.rb")
        begin
          response = eval(file) # evaluate file to make sure it's a valid Ruby file
        rescue
          puts "#{scenario.split("/").last}'s executable raised an error"
        end
      end
      it "#{scenario.split("/").last}" do
        response.should_not be_nil
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.1337415404447309, 'fraction_numerical': 0.0, 'mean_word_length': 4.878787878787879, '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': '5769746', 'n_tokens_mistral': 1011, 'n_tokens_neox': 1009, 'n_words': 207}