<commit_before>require 'integration_spec_helper'

describe 'cap install', slow: true do

  context 'with defaults' do
    before :all do
      create_test_app
      Dir.chdir(test_app_path) do
        %x[bundle exec cap install]
      end
    end

    describe 'installation' do

      it 'creates config/deploy' do
        path = test_app_path.join('config/deploy')
        expect(Dir.exists?(path)).to be_true
      end

      it 'creates lib/capistrano/tasks' do
        path = test_app_path.join('lib/capistrano/tasks')
        expect(Dir.exists?(path)).to be_true
      end

      it 'creates the deploy file' do
        file = test_app_path.join('config/deploy.rb')
        expect(File.exists?(file)).to be_true
      end

      it 'creates the stage files' do
        staging = test_app_path.join('config/deploy/staging.rb')
        production = test_app_path.join('config/deploy/production.rb')
        expect(File.exists?(staging)).to be_true
        expect(File.exists?(production)).to be_true
      end

    end
  end

  context 'with STAGES' do
    before :all do
      create_test_app
      Dir.chdir(test_app_path) do
        %x[bundle exec cap install STAGES=qa,production]
      end
    end

    describe 'installation' do

      it 'creates config/deploy' do
        path = test_app_path.join('config/deploy')
        expect(Dir.exists?(path)).to be_true
      end

      it 'creates lib/capistrano/tasks' do
        path = test_app_path.join('lib/capistrano/tasks')
        expect(Dir.exists?(path)).to be_true
      end

      it 'creates the deploy file' do
        file = test_app_path.join('config/deploy.rb')
        expect(File.exists?(file)).to be_true
      end

      it 'creates the stage files specified, not the defaults' do
        qa = test_app_path.join('config/deploy/qa.rb')
        production = test_app_path.join('config/deploy/production.rb')
        staging = test_app_path.join('config/deploy/staging.rb')
        expect(File.exists?(qa)).to be_true
        expect(File.exists?(production)).to be_true
        expect(File.exists?(staging)).to be_false
      end

    end
  end
end
<commit_msg>include installation integration tests in main suite run<commit_after>require 'integration_spec_helper'

describe 'cap install' do

  context 'with defaults' do
    before :all do
      create_test_app
      Dir.chdir(test_app_path) do
        %x[bundle exec cap install]
      end
    end

    describe 'installation' do

      it 'creates config/deploy' do
        path = test_app_path.join('config/deploy')
        expect(Dir.exists?(path)).to be_true
      end

      it 'creates lib/capistrano/tasks' do
        path = test_app_path.join('lib/capistrano/tasks')
        expect(Dir.exists?(path)).to be_true
      end

      it 'creates the deploy file' do
        file = test_app_path.join('config/deploy.rb')
        expect(File.exists?(file)).to be_true
      end

      it 'creates the stage files' do
        staging = test_app_path.join('config/deploy/staging.rb')
        production = test_app_path.join('config/deploy/production.rb')
        expect(File.exists?(staging)).to be_true
        expect(File.exists?(production)).to be_true
      end

    end
  end

  context 'with STAGES' do
    before :all do
      create_test_app
      Dir.chdir(test_app_path) do
        %x[bundle exec cap install STAGES=qa,production]
      end
    end

    describe 'installation' do

      it 'creates config/deploy' do
        path = test_app_path.join('config/deploy')
        expect(Dir.exists?(path)).to be_true
      end

      it 'creates lib/capistrano/tasks' do
        path = test_app_path.join('lib/capistrano/tasks')
        expect(Dir.exists?(path)).to be_true
      end

      it 'creates the deploy file' do
        file = test_app_path.join('config/deploy.rb')
        expect(File.exists?(file)).to be_true
      end

      it 'creates the stage files specified, not the defaults' do
        qa = test_app_path.join('config/deploy/qa.rb')
        production = test_app_path.join('config/deploy/production.rb')
        staging = test_app_path.join('config/deploy/staging.rb')
        expect(File.exists?(qa)).to be_true
        expect(File.exists?(production)).to be_true
        expect(File.exists?(staging)).to be_false
      end

    end
  end
end

{'fraction_non_alphanumeric': 0.10379334419362346, 'fraction_numerical': 0.0, 'mean_word_length': 2.540362438220758, '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': '6329053', 'n_tokens_mistral': 1385, 'n_tokens_neox': 1346, 'n_words': 301}