Sha256: 0c758036fddffefa5ea091fc91d355feaa6785be23c974cc5634ed240cacb805

Contents?: true

Size: 1.09 KB

Versions: 23

Compression:

Stored size: 1.09 KB

Contents

# typed: false
# frozen_string_literal: true

ENV["RAILS_ENV"] ||= "test"

require_relative Rails.application.root.join("config", "environment.rb").to_s

module Hephaestus
  module TestHelper
    require "minitest/autorun"
    require "minitest/pride"

    require "debug" if ENV.fetch("DEBUG", false)

    if ENV["COVERAGE"] == "1"
      require "simplecov"
      require "simplecov-console"

      SimpleCov.start("rails")

      # do not crash on failure; we want a distinct job to report the coverage error
      module SimpleCov
        class << self
          def result_exit_status(_)
            SimpleCov::ExitCodes::SUCCESS
          end
        end
      end
    end

    require "webmock"
    require "httpx/adapters/webmock"
    require "webmock/minitest"
    WebMock.enable!
    WebMock.disable_net_connect!(allow_localhost: true)

    require_relative "support/rails"

    # Load everything else from engine's test/support
    Dir[File.expand_path("support/hephaestus/**/*.rb", __dir__)].each { |rb| require(rb) }

    # https://github.com/freerange/mocha#rails
    require "mocha/minitest"
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
hephaestus-0.8.10 lib/hephaestus/test_helper.rb
hephaestus-0.8.9.2 lib/hephaestus/test_helper.rb
hephaestus-0.8.9.1 lib/hephaestus/test_helper.rb
hephaestus-0.8.9 lib/hephaestus/test_helper.rb
hephaestus-0.8.8 lib/hephaestus/test_helper.rb
hephaestus-0.8.7.5 lib/hephaestus/test_helper.rb
hephaestus-0.8.7.4 lib/hephaestus/test_helper.rb
hephaestus-0.8.7.3 lib/hephaestus/test_helper.rb
hephaestus-0.8.7.2 lib/hephaestus/test_helper.rb
hephaestus-0.8.7.1 lib/hephaestus/test_helper.rb
hephaestus-0.8.7 lib/hephaestus/test_helper.rb
hephaestus-0.8.6 lib/hephaestus/test_helper.rb
hephaestus-0.8.5 lib/hephaestus/test_helper.rb
hephaestus-0.8.4.1 lib/hephaestus/test_helper.rb
hephaestus-0.8.4 lib/hephaestus/test_helper.rb
hephaestus-0.8.3.4 lib/hephaestus/test_helper.rb
hephaestus-0.8.3.3 lib/hephaestus/test_helper.rb
hephaestus-0.8.3.2 lib/hephaestus/test_helper.rb
hephaestus-0.8.3.1 lib/hephaestus/test_helper.rb
hephaestus-0.8.3 lib/hephaestus/test_helper.rb