<commit_before>require "spec_helper"

RSpec.describe "Generating a new project" do
  before(:example) do
    remove_dummy_app
    run_arkenstone("--skip-bundle")
  end

  it "creates a .ruby-version file" do
    ruby_version_file = File.join(project_path, ".ruby-version")
    expected_contents = Arkenstone::RUBY_VERSION + "\n"

    expect(File.exist?(ruby_version_file)).to be true
    expect(file_contents(ruby_version_file)).to eq(expected_contents)
  end

  it "installs Simple Form" do
    simple_form_initializer = File.join(config_path, "/initializers/simple_form.rb")
    simple_form_locale = File.join(config_path, "/locales/simple_form.en.yml")
    simple_form_partial = File.join(lib_path, "/templates/html/scaffold/_form.html.erb")

    expect(File.exist?(simple_form_initializer)).to be true
    expect(File.exist?(simple_form_locale)).to be true
    expect(File.exist?(simple_form_partial)).to be true
  end

  it "automatically adds all files to local Git repo and makes an initial commit" do
    git_opts = "--git-dir=#{project_path}/.git"
    git_opts << " --work-tree=#{project_path}"

    expect(`git #{git_opts} log -1`).to match(/Initial commit/)
  end
end<commit_msg>Set Git identity<commit_after>require "spec_helper"

RSpec.describe "Generating a new project" do
  before(:example) do
    remove_dummy_app
    run_arkenstone("--skip-bundle")
  end

  it "creates a .ruby-version file" do
    ruby_version_file = File.join(project_path, ".ruby-version")
    expected_contents = Arkenstone::RUBY_VERSION + "\n"

    expect(File.exist?(ruby_version_file)).to be true
    expect(file_contents(ruby_version_file)).to eq(expected_contents)
  end

  it "installs Simple Form" do
    simple_form_initializer = File.join(config_path, "/initializers/simple_form.rb")
    simple_form_locale = File.join(config_path, "/locales/simple_form.en.yml")
    simple_form_partial = File.join(lib_path, "/templates/html/scaffold/_form.html.erb")

    expect(File.exist?(simple_form_initializer)).to be true
    expect(File.exist?(simple_form_locale)).to be true
    expect(File.exist?(simple_form_partial)).to be true
  end

  it "automatically adds all files to local Git repo and makes an initial commit" do
    `git config user.email "<EMAIL>"`
    `git config user.name "CI Tester"`
    git_opts = "--git-dir=#{project_path}/.git"
    git_opts << " --work-tree=#{project_path}"

    expect(`git #{git_opts} log -1`).to match(/Initial commit/)
  end
end
{'fraction_non_alphanumeric': 0.12439024390243902, 'fraction_numerical': 0.0008130081300813008, 'mean_word_length': 4.3268398268398265, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 4, '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': '2116479', 'n_tokens_mistral': 829, 'n_tokens_neox': 808, 'n_words': 174}