Permalink
Browse files

Use new github markdown syntax features.

  • Loading branch information...
1 parent bdd8e95 commit aa61962755f4cdc03e4799600725f3eae915f927 @myronmarston myronmarston committed May 6, 2011
Showing with 18 additions and 16 deletions.
  1. +18 −16 README.md
View
34 README.md
@@ -4,23 +4,25 @@ Record your test suite's HTTP interactions and replay them during future test ru
## Synopsis
- require 'rubygems'
- require 'test/unit'
- require 'vcr'
-
- VCR.config do |c|
- c.cassette_library_dir = 'fixtures/vcr_cassettes'
- c.stub_with :webmock # or :fakeweb
- end
-
- class VCRTest < Test::Unit::TestCase
- def test_example_dot_com
- VCR.use_cassette('synopsis') do
- response = Net::HTTP.get_response(URI('http://www.iana.org/domains/example/'))
- assert_match /Example Domains/, response.body
- end
- end
+``` ruby
+require 'rubygems'
+require 'test/unit'
+require 'vcr'
+
+VCR.config do |c|
+ c.cassette_library_dir = 'fixtures/vcr_cassettes'
+ c.stub_with :webmock # or :fakeweb
+end
+
+class VCRTest < Test::Unit::TestCase
+ def test_example_dot_com
+ VCR.use_cassette('synopsis') do
+ response = Net::HTTP.get_response(URI('http://www.iana.org/domains/example/'))
+ assert_match /Example Domains/, response.body
end
+ end
+end
+```
Run this test once, and VCR will record the http request to `fixtures/vcr_cassettes/synopsis.yml`. Run it again, and VCR
will replay the response from iana.org when the http request is made. This test is now fast (no real HTTP requests are

0 comments on commit aa61962

Please sign in to comment.