<commit_before>
shared_context 'in a new module' do |name|
  before(:all) do
    system("pdk new module #{name} --skip-interview") || raise
    Dir.chdir(name)
  end

  after(:all) do
    Dir.chdir('..')
    FileUtils.rm_rf(name)
  end
end<commit_msg>(maint) Capture 'pdk new module' output when setting up acceptance tests<commit_after>require 'open3'

shared_context 'in a new module' do |name|
  before(:all) do
    output, status = Open3.capture2e('pdk', 'new', 'module', name, '--skip-interview')

    raise "Failed to create test module:\n#{output}" unless status.success?

    Dir.chdir(name)
  end

  after(:all) do
    Dir.chdir('..')
    FileUtils.rm_rf(name)
  end
end
{'fraction_non_alphanumeric': 0.14580265095729014, 'fraction_numerical': 0.004418262150220913, 'mean_word_length': 3.689655172413793, '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': '4031054', 'n_tokens_mistral': 242, 'n_tokens_neox': 237, 'n_words': 67}