Sha256: bfb2e6f2e239d927fe94fb2a52923479545b39e602163069629c7a99a0878152

Contents?: true

Size: 1.09 KB

Versions: 22

Compression:

Stored size: 1.09 KB

Contents

# typed: false
# frozen_string_literal: true

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

require_relative File.join($LOAD_PATH.last, "..", "config", "environment.rb")

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

22 entries across 22 versions & 1 rubygems

Version Path
hephaestus-0.7.7.2 lib/hephaestus/test_helper.rb
hephaestus-0.7.7 lib/hephaestus/test_helper.rb
hephaestus-0.7.6.2 lib/hephaestus/test_helper.rb
hephaestus-0.7.6.1 lib/hephaestus/test_helper.rb
hephaestus-0.7.6 lib/hephaestus/test_helper.rb
hephaestus-0.7.5.3 lib/hephaestus/test_helper.rb
hephaestus-0.7.5.2 lib/hephaestus/test_helper.rb
hephaestus-0.7.5.1 lib/hephaestus/test_helper.rb
hephaestus-0.7.5 lib/hephaestus/test_helper.rb
hephaestus-0.7.4.2 lib/hephaestus/test_helper.rb
hephaestus-0.7.4.1 lib/hephaestus/test_helper.rb
hephaestus-0.7.4 lib/hephaestus/test_helper.rb
hephaestus-0.7.3.1 lib/hephaestus/test_helper.rb
hephaestus-0.7.3 lib/hephaestus/test_helper.rb
hephaestus-0.7.2.5 lib/hephaestus/test_helper.rb
hephaestus-0.7.2.4 lib/hephaestus/test_helper.rb
hephaestus-0.7.2.3 lib/hephaestus/test_helper.rb
hephaestus-0.7.2.2 lib/hephaestus/test_helper.rb
hephaestus-0.7.2.1 lib/hephaestus/test_helper.rb
hephaestus-0.7.2 lib/hephaestus/test_helper.rb