fakeweb icon indicating copy to clipboard operation
fakeweb copied to clipboard

a method to help with testing/debugging

Open ryandotsmith opened this issue 15 years ago • 0 comments

Hey!

I have found myself checking FakeWeb::Registry.uri_map a lot lately. Most of the time when I do this I am looking to make sure that I am stubbing the correct uris. This is necessary when I have helper methods generate stubs dynamically....

Anyways, I did a closure over uri_map. Not sure this is the most idiomatic way to handle this, but it led to some nice syntax.

Fakeweb::Registry.uri_map.inspect #=> [uri,uri]

Also, I am thinking of adding a counter the registry that show how many time the stubbed uri has been hit. Any thoughts on this?

ryandotsmith avatar Jan 09 '11 00:01 ryandotsmith