README.markdown in sham_rack-1.2.1 vs README.markdown in sham_rack-1.3.0
- old
+ new
@@ -55,9 +55,20 @@
### Any old app
ShamRack.mount(my_google_stub, "google.com")
+### General-purpose stubbing
+
+ @stub_app = ShamRack.at("stubbed.com").stub
+
+ open("http://stubbed.com/greeting").read #=> OpenURI::HTTPError: 404
+
+ @stub_app.register_resource("/greeting", "Hello, world!", "text/plain")
+
+ open("http://stubbed.com/greeting").read #=> "Hello, world!"
+ @stub_app.last_request.path #=> "/greeting"
+
What's the catch?
-----------------
* Your Rack request-handling code runs in the same Ruby VM, in fact the same Thread, as your request.