Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http.Header create helper for convenience #2

Open
cyucelen opened this issue Feb 18, 2020 · 0 comments
Open

http.Header create helper for convenience #2

cyucelen opened this issue Feb 18, 2020 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers
Projects

Comments

@cyucelen
Copy link
Contributor

cyucelen commented Feb 18, 2020

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"))
@cyucelen cyucelen created this issue from a note in Aduket (To do) Feb 18, 2020
@cyucelen cyucelen added enhancement New feature or request good first issue Good for newcomers labels Feb 18, 2020
@cyucelen cyucelen changed the title Add commonly used http headers in aduket package for convenience http.Header create helper for convenience Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Aduket
  
To do
Development

No branches or pull requests

1 participant