Wednesday, July 15, 2026 1:13:03 AM
> project show esm_bot
A sophisticated Discord bot that bridges Arma 3 Exile servers with Discord communities. Built in Ruby with secure TCP communication, it delivers territory management, real-time notifications, and comprehensive server administration right in your Discord channels.
Details
> spec_helper.rb
# frozen_string_literal: true

# Set to false for indefinite wait_timeout
SPEC_TIMEOUT_SECONDS = 10

LOG_LEVEL = ENV.fetch("LOG_LEVEL", "error").downcase.to_sym

require_relative "pre_init"
require_relative "spec_config"

RSpec.configure do |config|
  config.before :suite do
    FactoryBot.definition_file_paths = [ESM.root.join("spec", "support", "factories")]
    FactoryBot.find_definitions

    DatabaseCleaner.strategy = :deletion
    DatabaseCleaner[:active_record, db: ESM::ExileAccount].strategy = :deletion
    DatabaseCleaner.clean
  end

  config.around do |example|
    trace!(
      example_group: example.example_group&.description,
      example: example.description
    )

    ESM.discord_bot.test_outbox.clear
    ESM.discord_bot.test_inbox.clear
    ESM::Test.territory_admin_uids = []
    ESM::Test.skip_cooldown = false
    ESM.discord_bot.delivery_overseer.queue.clear
    ESM::Arma::Server.pause

    cache_snapshot = ESM.discord_bot.snapshot

    begin
      DatabaseCleaner.cleaning { example.run }
    ensure
      ESM.discord_bot.restore(cache_snapshot)
    end
  end
end

# These must be the last lines in this file. ESM.run! triggers post-init
# (database connection, command load) and the bot's no-op #run override that
# flips @esm_status to :ready. No gateway connection.
ESM.run!
All opinions represented herein are my own
- © 2024 - 2026 itsthedevman
- build 43aa0d7