The regexp support is great!
I think next step towards making this absolutely awesome (and useful)
is to use the matched information from the url in the response.
Something like this comes to my mind:
FakeWeb.register_uri :any, %r{
http://somesite.com/search?query=([^&]*)
&max_results=([^&]*)} do |query, max_results|
if query == "cheeseburger"
"You gotta be kidding"
else
"Found: #{query}! " * max_results.to_i
end
end
or maybe :body and :response objects accepting Proc objects to
evaluate the response.
I am only contributing with ideas by now, if I get some free time I'll
take a look at the code and implement the functionality.
Kudos for the great work!
> since mid-April or so. :) Seehttp://
github.com/chrisk/fakeweb/network