Skip to content

Commit

Permalink
Merge pull request #1 from vaibhavramadurai/master
Browse files Browse the repository at this point in the history
Allow mocking calls at root level
  • Loading branch information
Jesse0Michael authored Dec 4, 2017
2 parents e115920 + f904cf0 commit 2a38c91
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
4 changes: 0 additions & 4 deletions assured/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ func (c *Client) Given(call Call) error {
return fmt.Errorf("cannot stub call without Method")
}

if call.Path == "" {
return fmt.Errorf("cannot stub call without Path")
}

if call.Response == nil {
req, err = http.NewRequest(call.Method, fmt.Sprintf("http://localhost:%d/given/%s", c.Port, call.Path), nil)
} else {
Expand Down
9 changes: 0 additions & 9 deletions assured/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,6 @@ func TestClientGivenMethodFailure(t *testing.T) {
require.Equal(t, "cannot stub call without Method", err.Error())
}

func TestClientGivenPathFailure(t *testing.T) {
client := NewDefaultClient()

err := client.Given(Call{Method: "GOT"})

require.Error(t, err)
require.Equal(t, "cannot stub call without Path", err.Error())
}

func TestClientBadRequestFailure(t *testing.T) {
client := NewDefaultClient()

Expand Down

0 comments on commit 2a38c91

Please sign in to comment.