Re: Retrieving last request from WebMock

278 views
Skip to first unread message

Rainer Kuhn

unread,
Jun 13, 2013, 4:54:33 PM6/13/13
to webmoc...@googlegroups.com
Hi, I used somthing along the lines of WebMock::RequestRegistry.instance.to_s.should match /#{Time.now.year}/

I sometimes have trouble checking for the right body variables.

Ray


On 11 June 2013 23:12, Andrew <and...@copiousinc.com> wrote:
Just wondering...is there a way to retrieve the last request from WebMock? Or an array of recent requests? I didn't see any mention of it in the readme.

If there were, I could perform my own assertions on the request bodies without needing to require and conform to the webmock/* assertion style.

--Andrew

--
 
---
You received this message because you are subscribed to the Google Groups "webmock-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webmock-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Bartosz Blimke

unread,
Jun 14, 2013, 9:54:31 AM6/14/13
to webmoc...@googlegroups.com
I'm afraid WebMock::RequestRegistry doesn't keep the order of requests.

I suggest you add a custom callback WebMock.after_request {|request_signature, response| @last_request = request_signature }


2013/6/13 Rainer Kuhn <ticktri...@gmail.com>
Reply all
Reply to author
Forward
0 new messages