<commit_before>require 'spec_helper'

describe 'database migrations', type: :aruba do
  context 'after a migration was generated' do
    before { write_file('config/database.yml',
      File.read(File.expand_path('fixtures/database_without_username_and_password.yml', __dir__))) }

    before { run_simple('bundle exec rails g migration CreateModels name:string') }

    describe 'bundle exec rake db:migrate' do
      let(:action) { run('bundle exec rake db:migrate') }
      let(:last_command) { action && last_command_started }

      specify { expect(last_command).to be_successfully_executed }
      specify { expect(last_command).to have_output(/CreateModels: migrated/) }
    end
  end


  describe 'rerun bundle exec rake db:drop db:create db:migrate', :announce_stdout, :announce_stderr, issue: 56 do
    let(:command) { 'bundle exec rake db:drop db:create db:migrate' }
    before do
      copy(
        '../../spec/aruba/fixtures/database_without_username_and_password.yml',
        'config/database.yml'
      )
      copy(<commit_msg>:neckbeard: Remove std{out,err} announce in aruba [skip ci]<commit_after>require 'spec_helper'

describe 'database migrations', type: :aruba do
  context 'after a migration was generated' do
    before { write_file('config/database.yml',
      File.read(File.expand_path('fixtures/database_without_username_and_password.yml', __dir__))) }

    before { run_simple('bundle exec rails g migration CreateModels name:string') }

    describe 'bundle exec rake db:migrate' do
      let(:action) { run('bundle exec rake db:migrate') }
      let(:last_command) { action && last_command_started }

      specify { expect(last_command).to be_successfully_executed }
      specify { expect(last_command).to have_output(/CreateModels: migrated/) }
    end
  end


  describe 'rerun bundle exec rake db:drop db:create db:migrate', issue: 56 do
    let(:command) { 'bundle exec rake db:drop db:create db:migrate' }
    before do
      copy(
        '../../spec/aruba/fixtures/database_without_username_and_password.yml',
        'config/database.yml'
      )
      copy(
{'fraction_non_alphanumeric': 0.11074144486692016, 'fraction_numerical': 0.0019011406844106464, 'mean_word_length': 3.872685185185185, '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': '3841292', 'n_tokens_mistral': 653, 'n_tokens_neox': 636, 'n_words': 156}