Sha256: 115c74dea580b79b6640f638db4288d4ff7b0a05754d1a2d2e4efe5957f25e45

Contents?: true

Size: 456 Bytes

Versions: 3

Compression:

Stored size: 456 Bytes

Contents

# frozen_string_literal: true
require "test_helper"

class Status4xxTest < Minitest::Test
  test "detects as error" do
    register_uri(:get, "http://example.org/", status: 404)
    response = Aitch.get("http://example.org/")

    assert response.error?
  end

  test "sets error" do
    register_uri(:get, "http://example.org/", status: 404)
    response = Aitch.get("http://example.org/")

    assert_equal Aitch::NotFoundError, response.error
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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