Closed xoebus closed 11 years ago
:) nice... i'll take a look!
On Sun, Oct 20, 2013 at 2:25 PM, Chris Brown notifications@github.comwrote:
I'm writing a test to make sure that one of my methods makes the correct request to a web server. It uses a lot of query parameters to do this which unfortunately look an awful lot like format strings.
A snippet of the code is below:
Context("with a valid bookmark request", func() {var request AddBookmarkRequest BeforeEach(func() { request = AddBookmarkRequest{ URL: "http://google.com", Title: "Google Search", Description: "Seems like a cool underground site!", Tags: []string{"search", "mail", "maps"}, CreatedAt: time.Now(), Replace: true, Shared: false, }}) It("makes a request to add a bookmark", func() { client.AddBookmark(request)
urlParams := url.Values{} urlParams.Set("format", "json") urlParams.Set("auth_token", "user:token") urlParams.Set("url", request.URL) urlParams.Set("description", request.Title) urlParams.Set("extended", request.Description) urlParams.Set("tags", strings.Join(request.Tags, ",")) urlParams.Set("dt", request.CreatedAt.Format(time.RFC3339)) urlParams.Set("replace", "yes") urlParams.Set("shared", "no") lastAddUrl := fmt.Sprintf("https://api.pinboard.in/v1/posts/add?%s", urlParams.Encode()) Expect(httpClient.LastURLRequested).To(Equal(lastAddUrl))})
lastAddUrl looks something like this at the end of this:
auth_token=user%3Atoken&description=Google+Search&dt=2013-10-20T22%3A13%3A13%2B01%3A00&extended=Seems+like+a+cool+underground+site%21&format=json&replace=yes&shared=no&tags=search%2Cmail%2Cmaps&url=http%3A%2F%2Fgoogle.com
Ginkgo reports the failure like so:
[image: screenshot 2013-10-20 22 23 33]https://f.cloud.github.com/assets/38814/1368985/f70cdeb8-39cd-11e3-8f65-ae4320bb0b8e.png
Looks (MISSING) funky.
— Reply to this email directly or view it on GitHubhttps://github.com/onsi/ginkgo/issues/10 .
Should be fixed now Chris. Pull the latest and lemme know if you still have issues.
Still seeing the problem here on master.
Reproducible by checking out xoebus/kingpin@a3ae4400dc8fd0b91f1b8aaa616083391158d3da and changing line 56 of add_bookmark_test.go
so that it will fail.
actually, looks good on master for me... odd -- can you try again?
Apologies, I'd updated the code but not the ginkgo
executable. The issue is indeed fixed - thank you!
Hooray! :)
On Oct 24, 2013, at 7:35 AM, Chris Brown notifications@github.com wrote:
Apologies, I'd updated the code but not the ginkgo executable. The issue is indeed fixed - thank you!
— Reply to this email directly or view it on GitHub.
I'm writing a test to make sure that one of my methods makes the correct request to a web server. It uses a lot of query parameters to do this which unfortunately look an awful lot like format strings.
A snippet of the code is below:
lastAddUrl
looks something like this at the end of this:Ginkgo reports the failure like so:
Looks (MISSING) funky.