<commit_before>require 'spec_helper'

describe Lobot::InstallGenerator do
  include GeneratorSpec::TestCase
  destination File.expand_path("../tmp", __FILE__)
  # arguments %w(something)

  before(:each) do
    prepare_destination
    run_generator
  end

  it "creates ci.yml" do
    assert_file "config/ci.yml", /app_name/
  end

  it "create bootstrap_server.sh" do
    assert_file "script/bootstrap_server.sh", /bin\/bash/
  end

  it "creates a ci_build.sh file" do
    assert_file "script/ci_build.sh"
  end

  it "makes ci_build.sh executable" do
    system("test -x #{destination_root}/script/ci_build.sh").should == true
  end

  context "Capfile exists" do
    it "appends a load path to the Capfile" do
      prepare_destination
      system("echo 'line 2' > #{destination_root}/Capfile")
      run_generator
      assert_file "Capfile", "load 'config/capistrano/ci'\nline 2\n"
    end
  end

  context "Capfile doesn't exist" do<commit_msg>Clean up spec/tmp after spec runs.<commit_after>require 'spec_helper'
require "fileutils"

describe Lobot::InstallGenerator do
  include GeneratorSpec::TestCase
  destination File.expand_path("../tmp", __FILE__)
  # arguments %w(something)

  before do
    prepare_destination
    run_generator
  end

  after :all do
    FileUtils.rm_rf ::File.expand_path("../tmp", __FILE__)
  end

  it "creates ci.yml" do
    assert_file "config/ci.yml", /app_name/
  end

  it "create bootstrap_server.sh" do
    assert_file "script/bootstrap_server.sh", /bin\/bash/
  end

  it "creates a ci_build.sh file" do
    assert_file "script/ci_build.sh"
  end

  it "makes ci_build.sh executable" do
    system("test -x #{destination_root}/script/ci_build.sh").should == true
  end

  context "Capfile exists" do
    it "appends a load path to the Capfile" do
      prepare_destination
      system("echo 'line 2' > #{destination_root}/Capfile")
      run_generator
      assert_file "Capfile", "load 'config/capistrano/ci'\nline 2\n"
    end
  end

  context "Capfile doesn't exist" do
{'fraction_non_alphanumeric': 0.10594059405940594, 'fraction_numerical': 0.0019801980198019802, 'mean_word_length': 3.4613686534216335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4585444', 'n_tokens_mistral': 690, 'n_tokens_neox': 654, 'n_words': 179}