Sha256: d71c3e6c56fc2d8390f75bef39025147b18192ad9e006fa18a9d6b526d9493ae

Contents?: true

Size: 451 Bytes

Versions: 3

Compression:

Stored size: 451 Bytes

Contents

# frozen_string_literal: true
require "test_helper"

class ErrorsTest < Minitest::Test
  Aitch::Response::ERRORS.each do |code, exception|
    name = Aitch::Utils.underscore(exception.name.split("::").last).gsub("_error", "")

    test "detects response as #{name}" do
      config = {}
      http_response = stub(code: code)
      response = Aitch::Response.new(config, http_response)

      assert response.public_send("#{name}?")
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
aitch-1.0.2 test/aitch/response/errors_test.rb
aitch-1.0.1 test/aitch/response/errors_test.rb
aitch-1.0.0 test/aitch/response/errors_test.rb