<commit_before>require 'spec_helper'

describe Columns do

  describe 'executes the application' do
    before { create_clean_user_rb }
    after { remove_user_rb }

    specify 'on virgin models', :speed => 'slow' do
      schema_dir = 'spec/fixtures'
      models_dir = 'spec/fixtures'

      Columns.execute(schema_dir: schema_dir, models_dir: models_dir)

      expect(user_rb_file).to eq integration_user_filled_file
    end

    skip 'on already annotated models', :speed => 'slow' do
    end

  end

  context 'when there is no schema' do
    it 'outputs an error message', :speed => 'slow' do
      schema_dir = 'spec/'
      models_dir = 'spec/fixtures'

      lambda do
        expect(STDOUT).to receive(:puts).with(/^COLUMNS ERROR.*/)
        Columns.execute(schema_dir: schema_dir, models_dir: models_dir)
      end
    end

    it 'exits with status code 1', :speed => 'slow' do
      schema_dir = 'spec/'
      models_dir = 'spec/fixtures'

      begin<commit_msg>Remove the test for the output message<commit_after>require 'spec_helper'

describe Columns do

  describe 'executes the application' do
    before { create_clean_user_rb }
    after { remove_user_rb }

    specify 'on virgin models', :speed => 'slow' do
      schema_dir = 'spec/fixtures'
      models_dir = 'spec/fixtures'

      Columns.execute(schema_dir: schema_dir, models_dir: models_dir)

      expect(user_rb_file).to eq integration_user_filled_file
    end

    skip 'on already annotated models', :speed => 'slow' do
    end

  end

  context 'when there is no schema' do
    it 'exits with status code 1', :speed => 'slow' do
      schema_dir = 'spec/'
      models_dir = 'spec/fixtures'

      begin
{'fraction_non_alphanumeric': 0.09467455621301775, 'fraction_numerical': 0.001183431952662722, 'mean_word_length': 3.016627078384798, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '5194880', 'n_tokens_mistral': 558, 'n_tokens_neox': 519, 'n_words': 156}