]> khamidou — GitHub mirrors - vcrpy.git/commitdiff
clarify the readme a bit
authorKevin McCarthy <me@kevinmccarthy.org>
Tue, 20 Aug 2013 05:17:24 +0000 (19:17 -1000)
committerKevin McCarthy <me@kevinmccarthy.org>
Tue, 20 Aug 2013 05:49:06 +0000 (19:49 -1000)
README.md

index a1c050b3a509bae94f106ecae6766f49adb3ae78..3e2044c5f673c91b0fa41342fcbb342632483860 100644 (file)
--- a/README.md
+++ b/README.md
@@ -111,17 +111,37 @@ The Request object has the following properties
 
 ## Register your own serializer
 
+Don't like JSON or YAML?  That's OK, VCR.py can serialize to any format
+you would like.  Create your own class that has 2 classmethods:
+
+ * `def load(cls, cassette_path)`
+ * `def dumps(cls, requests, responses)`
+
+Finally, register your class with VCR to use your
+new serializer.
+
 ```
 import vcr
 
-MySerializer(object):
+BogoSerializer(object):
     """
-    Must implement serialize() and deserialize() classmethods
+    Must implement load() and dumps() classmethods
     """
     pass
 
 my_vcr = VCR()
-my_vcr.register_serializer('my', MySerializer)
+my_vcr.register_serializer('bogo', BogoSerializer)
+
+with my_vcr.use_cassette('test.bogo', serializer='bogo'):
+    # your http here
+
+# After you register, you can set the default serializer to your new serializer
+
+my_vcr.serializer = 'bogo'
+
+with my_vcr.use_cassette('test.bogo'):
+    # your http here
+
 ```
 
 ##Installation