Skip to content

http.Header create helper for convenience  #2

@cyucelen

Description

@cyucelen

Problem:

When asserting http headers, it is verbose to create expected http headers.

Such as:

expectedHeader := http.Header{}
expectedHeader.Add("X-If-You-Read-This", "send-a-hadouken-back")
requestRecorder.AssertHeaderEqual(t, expectedHeader)

Solution:

A wrapper for creating http.Header and adding the initial key-value pair can be written for conciseness.

Such as:

requestRecorder.AssertHeaderEqual(t, aduket.ExpectedHeader("X-If-You-Read-This", "send-a-hadouken-back"))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions