<commit_before>require "spec_helper"

RSpec.describe SchemaMigrator do
  before(:each) do
    clean_index_content("govuk_test")
  end

  it "switches the alias to a new index" do
    index_group = search_server.index_group("govuk_test")
    original_index = index_group.current_real

    migrator = described_class.new("govuk_test", wait_between_task_list_check: 0.2, io: StringIO.new)
    migrator.reindex
    migrator.switch_to_new_index
<commit_msg>Fix RSpec/HookArgument offences<commit_after>require "spec_helper"

RSpec.describe SchemaMigrator do
  before do
    clean_index_content("govuk_test")
  end

  it "switches the alias to a new index" do
    index_group = search_server.index_group("govuk_test")
    original_index = index_group.current_real

    migrator = described_class.new("govuk_test", wait_between_task_list_check: 0.2, io: StringIO.new)
    migrator.reindex
    migrator.switch_to_new_index

{'fraction_non_alphanumeric': 0.07868852459016394, 'fraction_numerical': 0.004371584699453552, 'mean_word_length': 5.026315789473684, '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': '2876304', 'n_tokens_mistral': 315, 'n_tokens_neox': 312, 'n_words': 62}