Skip to content

Commit

Permalink
Adding more tests for coverage (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
bengadbois committed Apr 5, 2017
1 parent aec4c28 commit b9d0bcd
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions lib/requester_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package pewpew

import (
"net/http"
"testing"
)

func TestRunRequest(t *testing.T) {
badRequest, err := http.NewRequest("GET", "http://1234567890.0987654321", nil)
if err != nil {
t.Errorf("failed to create bad http request")
}
//TODO setup a local http server and request that instead of using github
goodRequest, err := http.NewRequest("HEAD", "http://github.com", http.NoBody)
if err != nil {
t.Errorf("failed to create good http request")
}
cases := []struct {
r http.Request
c *http.Client
}{
{*badRequest, &http.Client{}},
{*goodRequest, &http.Client{}},
}
for _, c := range cases {
runRequest(c.r, c.c)
}
}

0 comments on commit b9d0bcd

Please sign in to comment.