Skip to content

Instantly share code, notes, and snippets.

@mschoch
Created June 16, 2011 20:19
Show Gist options
  • Save mschoch/1030163 to your computer and use it in GitHub Desktop.
Save mschoch/1030163 to your computer and use it in GitHub Desktop.
trundle use document after create operation test case output
2011-06-16 16:11:27.489 CouchpadAdministrator[2248:207] Create a document, should succeed
[info] [<0.94.0>] 127.0.0.1 - - 'POST' /demo 201
1> 2011-06-16 16:11:28.332 CouchpadAdministrator[2248:207] Success creating document: <CCouchDBDocument: 0xc402330> (id:d5550c6013fb685da5c2362708000ae6 rev:1-0ea42c86055137d3fab0630b63ae0646 {
firstName = Marty;
})
2011-06-16 16:11:28.332 CouchpadAdministrator[2248:207] Update document, should succeed, but will fail
[info] [<0.94.0>] 127.0.0.1 - - 'PUT' /demo/d5550c6013fb685da5c2362708000ae6 409
1> 2011-06-16 16:11:28.337 CouchpadAdministrator[2248:207] Failed to create document! Error Domain=CouchErrorDomain Code=-101 "Document update conflict." UserInfo=0xc400430 {json=<CFBasicHash 0xc402730 [0x17f2400]>{type = immutable dict, count = 2,
entries =>
0 : <CFString 0xc4026f0 [0x17f2400]>{contents = "reason"} = <CFString 0xc4003a0 [0x17f2400]>{contents = "Document update conflict."}
2 : <CFString 0xc400620 [0x17f2400]>{contents = "error"} = <CFString 0xc4026d0 [0x17f2400]>{contents = "conflict"}
}
, NSUnderlyingError=0xc401e70 "{"error":"conflict","reason":"Document update conflict."}
", NSLocalizedDescription=Document update conflict.}
2011-06-16 16:11:28.337 CouchpadAdministrator[2248:207] manually re-set the id and revision to force them into dictionary
2011-06-16 16:11:28.338 CouchpadAdministrator[2248:207] Update document, will succeed this time
[info] [<0.94.0>] 127.0.0.1 - - 'PUT' /demo/d5550c6013fb685da5c2362708000ae6 201
1> 2011-06-16 16:11:28.341 CouchpadAdministrator[2248:207] Success updating document: <CCouchDBDocument: 0xc402330> (id:d5550c6013fb685da5c2362708000ae6 rev:1-0ea42c86055137d3fab0630b63ae0646 {
id = d5550c6013fb685da5c2362708000ae6;
ok = 1;
rev = "2-6d29c302157d19baf758e711716330ee";
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment