-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from tinchodias/29-Fix-mongo3CollectionNames-t…
…o-list-beyond-firstBatch Add command find and getmore
- Loading branch information
Showing
61 changed files
with
341 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
operations | ||
databaseNames | ||
^ self listDatabases collect: [:each | each at: 'name' ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
operations | ||
databases | ||
| raw command | | ||
command := (OrderedIdentityDictionary new) | ||
at: #listDatabases put: 1; | ||
yourself. | ||
raw := (self admin command: command) at: 'databases'. | ||
^raw collect: [:each | self databaseNamed: (each at: 'name')] | ||
^ self databaseNames collect: [ :each | self databaseNamed: each ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
operations | ||
listDatabases | ||
| command | | ||
command := (OrderedIdentityDictionary new) | ||
at: #listDatabases put: 1; | ||
yourself. | ||
^ (self admin command: command) at: 'databases' |
9 changes: 9 additions & 0 deletions
9
mc/Mongo-Core.package/MongoCollection.class/instance/commandFind.readConcern..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
operations | ||
commandFind: filterDictionary readConcern: aConcern | ||
"Find (select) using Mongo command. Answer the output of the command. | ||
See more on https://docs.mongodb.com/manual/reference/command/find/" | ||
|
||
^ database | ||
commandFind: filterDictionary | ||
collection: name | ||
readConcern: aConcern |
28 changes: 28 additions & 0 deletions
28
mc/Mongo-Core.package/MongoCollection.class/instance/commandGetMore.batchSize.timeout..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
operations | ||
commandGetMore: cursorId batchSize: batchSizeOrNil timeout: aDurationOrNil | ||
"Get a batch of documents from this collection using a cursor id obtained via commandFind* (for example). | ||
Translates to: | ||
{ | ||
'getMore': <long>, | ||
'collection': <string>, | ||
'batchSize': <int>, | ||
'maxTimeMS': <int> | ||
} | ||
See: https://docs.mongodb.com/manual/reference/command/getMore/#dbcmd.getMore" | ||
|
||
| dictionary | | ||
dictionary := OrderedIdentityDictionary new | ||
at: #getMore put: cursorId; | ||
at: #collection put: name; | ||
yourself. | ||
|
||
batchSizeOrNil ifNotNil: [ | ||
dictionary at: #batchSize put: batchSizeOrNil ]. | ||
|
||
aDurationOrNil ifNotNil: [ | ||
dictionary at: #maxTimeMS put: aDurationOrNil asMilliSeconds ]. | ||
|
||
^ MongoQueryBatch newFromGetMoreResponse: (database command: dictionary) |
5 changes: 5 additions & 0 deletions
5
mc/Mongo-Core.package/MongoCollection.class/instance/ensureAdded.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
convenience | ||
ensureAdded | ||
[ database addCollection: name ] | ||
on: MongoCollectionAlreadyExists | ||
do: [ :error | ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Mongodb's provides find-like commands respond the first batch of a cursor. I help to enumerate documents in a database command reply with methods such as #contents, #do: and #collect:. | ||
|
||
See: | ||
https://docs.mongodb.com/manual/reference/command/find/ | ||
https://docs.mongodb.com/manual/reference/command/listCollections/ | ||
https://docs.mongodb.com/manual/reference/command/getMore/#dbcmd.getMore |
6 changes: 6 additions & 0 deletions
6
mc/Mongo-Core.package/MongoCommandCursor.class/class/database.dictionary..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
instance creation | ||
database: aMongoDatabase dictionary: aCollection | ||
^ self basicNew | ||
initializeDatabase: aMongoDatabase | ||
command: aCollection; | ||
yourself. |
3 changes: 3 additions & 0 deletions
3
mc/Mongo-Core.package/MongoCommandCursor.class/instance/batchSizeOrNil..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
batchSizeOrNil: anObject | ||
batchSizeOrNil := anObject |
3 changes: 3 additions & 0 deletions
3
mc/Mongo-Core.package/MongoCommandCursor.class/instance/batchSizeOrNil.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
batchSizeOrNil | ||
^ batchSizeOrNil |
4 changes: 4 additions & 0 deletions
4
mc/Mongo-Core.package/MongoCommandCursor.class/instance/collect..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
enumerating | ||
collect: aBlockClosure | ||
^ Array streamContents: [ :stream | | ||
self do: [ :each | stream nextPut: (aBlockClosure value: each) ] ] |
3 changes: 3 additions & 0 deletions
3
mc/Mongo-Core.package/MongoCommandCursor.class/instance/command.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
command | ||
^ command |
3 changes: 3 additions & 0 deletions
3
mc/Mongo-Core.package/MongoCommandCursor.class/instance/contents.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
enumerating | ||
contents | ||
^ self collect: #yourself |
3 changes: 3 additions & 0 deletions
3
mc/Mongo-Core.package/MongoCommandCursor.class/instance/database.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
database | ||
^ database |
8 changes: 8 additions & 0 deletions
8
mc/Mongo-Core.package/MongoCommandCursor.class/instance/do..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
enumerating | ||
do: aBlockClosure | ||
batch := MongoQueryBatch newFromFindResponse: (database command: command). | ||
|
||
[ batch documents do: aBlockClosure. | ||
batch atEnd ifTrue: [ ^self ]. | ||
batch := (database collectionAt: batch collectionName) commandGetMore: batch cursorId batchSize: self batchSizeOrNil timeout: self timeoutOrNil | ||
] repeat |
6 changes: 6 additions & 0 deletions
6
mc/Mongo-Core.package/MongoCommandCursor.class/instance/initializeDatabase.command..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
initialization | ||
initializeDatabase: aMongoDatabase command: aCollection | ||
self initialize. | ||
|
||
database := aMongoDatabase. | ||
command := aCollection. |
3 changes: 3 additions & 0 deletions
3
mc/Mongo-Core.package/MongoCommandCursor.class/instance/timeoutOrNil..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
timeoutOrNil: aDuration | ||
timeoutOrNil := aDuration |
3 changes: 3 additions & 0 deletions
3
mc/Mongo-Core.package/MongoCommandCursor.class/instance/timeoutOrNil.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
timeoutOrNil | ||
^ timeoutOrNil |
17 changes: 17 additions & 0 deletions
17
mc/Mongo-Core.package/MongoCommandCursor.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"commentStamp" : "MartinDias 7/30/2019 12:47", | ||
"super" : "Object", | ||
"category" : "Mongo-Core-Utilities", | ||
"classinstvars" : [ ], | ||
"pools" : [ ], | ||
"classvars" : [ ], | ||
"instvars" : [ | ||
"database", | ||
"batch", | ||
"command", | ||
"batchSizeOrNil", | ||
"timeoutOrNil" | ||
], | ||
"name" : "MongoCommandCursor", | ||
"type" : "normal" | ||
} |
6 changes: 5 additions & 1 deletion
6
mc/Mongo-Core.package/MongoDatabase.class/instance/addCollection..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
operations | ||
addCollection: aString | ||
^self addCollection: aString capped: false size: nil max: nil. | ||
^ self | ||
addCollection: aString | ||
capped: false | ||
size: nil | ||
max: nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
mc/Mongo-Core.package/MongoDatabase.class/instance/collectionAt..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
accessing | ||
collectionAt: aString | ||
"Answers the collection in this database that has aString as name (or nil)" | ||
"Answers a MongoCollection for this database that has aString as name (may not exist)." | ||
|
||
^ self collections | ||
detect: [ :e | e name = aString ] | ||
ifNone: [ nil ] | ||
^ MongoCollection database: self name: aString |
15 changes: 11 additions & 4 deletions
15
mc/Mongo-Core.package/MongoDatabase.class/instance/collectionNames.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
operations | ||
collectionNames | ||
"Answer the names of the collections in this database (for MongoDB >= 3.0). | ||
"Answer the names of the collections in this database. | ||
See more at https://docs.mongodb.com/manual/reference/command/listCollections/" | ||
|
||
| reply | | ||
reply := self command: {(#listCollections -> 1)} asDictionary. | ||
^ ((reply at: 'cursor') at: 'firstBatch') collect: [ :each | each at: 'name' ] | ||
| dictionary | | ||
dictionary := OrderedIdentityDictionary new | ||
at: #listCollections put: 1; | ||
at: #nameOnly put: true; | ||
yourself. | ||
|
||
^ (MongoCommandCursor | ||
database: self | ||
dictionary: dictionary) | ||
collect: [ :each | each at: 'name' ]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
mc/Mongo-Core.package/MongoDatabase.class/instance/commandFind.collection.readConcern..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
operations | ||
commandFind: filterDictionary collection: collectionName readConcern: aConcern | ||
|
||
| dict | | ||
dict := { | ||
'find' -> collectionName. | ||
'filter' -> filterDictionary. | ||
} as: OrderedDictionary. | ||
|
||
aConcern ifNotNil: [ | ||
dict at: 'readConcern' put: aConcern concernForCommand ]. | ||
|
||
^ MongoCommandCursor database: self dictionary: dict |
7 changes: 3 additions & 4 deletions
7
mc/Mongo-Core.package/MongoDatabase.class/instance/getCollection..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
operations | ||
getCollection: aString | ||
^ [ self addCollection: aString capped: false size: nil max: nil ] | ||
on: MongoCollectionAlreadyExists | ||
do: [ :err | | ||
MongoCollection database: self name: aString ] | ||
^ (self collectionAt: aString) | ||
ensureAdded; | ||
yourself |
6 changes: 6 additions & 0 deletions
6
mc/Mongo-Core.package/MongoDatabase.class/instance/listCollections.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
operations | ||
listCollections | ||
"Answer the raw response of listCollections command. | ||
See more at https://docs.mongodb.com/manual/reference/command/listCollections/" | ||
|
||
^ self command: { #listCollections -> 1 } asDictionary |
Empty file.
10 changes: 10 additions & 0 deletions
10
mc/Mongo-Core.package/MongoQueryBatch.class/class/newFromFindResponse..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
instance creation | ||
newFromFindResponse: aDictionary | ||
|
||
| cursorDictionary | | ||
cursorDictionary := aDictionary at: 'cursor'. | ||
^ self basicNew | ||
initializeWithCollectionName: (cursorDictionary at: 'ns') | ||
documents: (cursorDictionary at: 'firstBatch') | ||
cursorId: (cursorDictionary at: 'id'); | ||
yourself |
10 changes: 10 additions & 0 deletions
10
mc/Mongo-Core.package/MongoQueryBatch.class/class/newFromGetMoreResponse..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
instance creation | ||
newFromGetMoreResponse: aDictionary | ||
|
||
| cursorDictionary | | ||
cursorDictionary := aDictionary at: 'cursor'. | ||
^ self basicNew | ||
initializeWithCollectionName: (cursorDictionary at: 'ns') | ||
documents: (cursorDictionary at: 'nextBatch') | ||
cursorId: (cursorDictionary at: 'id'); | ||
yourself |
3 changes: 3 additions & 0 deletions
3
mc/Mongo-Core.package/MongoQueryBatch.class/instance/atEnd.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
atEnd | ||
^ self cursorId = 0 |
3 changes: 3 additions & 0 deletions
3
mc/Mongo-Core.package/MongoQueryBatch.class/instance/collectionName.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
collectionName | ||
^ collectionName |
3 changes: 3 additions & 0 deletions
3
mc/Mongo-Core.package/MongoQueryBatch.class/instance/cursorId.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
cursorId | ||
^ cursorId |
3 changes: 3 additions & 0 deletions
3
mc/Mongo-Core.package/MongoQueryBatch.class/instance/documents.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
documents | ||
^ documents |
8 changes: 8 additions & 0 deletions
8
...ackage/MongoQueryBatch.class/instance/initializeWithCollectionName.documents.cursorId..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
initialization | ||
initializeWithCollectionName: aString documents: aCollection cursorId: anInteger | ||
self initialize. | ||
|
||
self flag: #todo. "This code removes the db name, and it's a bit strange to have it here." | ||
collectionName := aString readStream upTo: $.; upToEnd. | ||
documents := aCollection. | ||
cursorId := anInteger. |
15 changes: 15 additions & 0 deletions
15
mc/Mongo-Core.package/MongoQueryBatch.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"commentStamp" : "", | ||
"super" : "Object", | ||
"category" : "Mongo-Core-Responses", | ||
"classinstvars" : [ ], | ||
"pools" : [ ], | ||
"classvars" : [ ], | ||
"instvars" : [ | ||
"documents", | ||
"collectionName", | ||
"cursorId" | ||
], | ||
"name" : "MongoQueryBatch", | ||
"type" : "normal" | ||
} |
2 changes: 1 addition & 1 deletion
2
mc/Mongo-Core.package/MongoReplicaSetConfig.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
mc/Mongo-Core.package/MongoReplicaSetConfigMember.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
mc/Mongo-Core.package/MongoReplicaSetStatus.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
mc/Mongo-Core.package/MongoReplicaSetStatusMember.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
8 changes: 8 additions & 0 deletions
8
...ongo-Tests-Core.package/MongoCommandCursorTest.class/instance/assertExpectedDocuments..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
tests | ||
assertExpectedDocuments: aCollection | ||
self assert: aCollection size equals: self expectedDocumentCount. | ||
|
||
aCollection doWithIndex: [ :each :index | | ||
self baseDocumentForTesting keysAndValuesDo: [ :key :value | | ||
self assert: (each at: key) equals: value ]. | ||
self assert: (each at: 'index') equals: index ]. |
Oops, something went wrong.