Skip to content

Commit 5481557

Browse files
RUBY-2859 Fix comment helper specification tests (#2421)
1 parent 823bb97 commit 5481557

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

spec/spec_tests/data/crud_unified/bulkWrite-comment.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ initialData: &initial_data
2828
- _id: 4
2929
x: 44
3030

31+
# Tests in this file differs from the one in specification repo because
32+
# Ruby dirver does not group bulk write operations by command.
33+
# See https://jira.mongodb.org/browse/DRIVERS-2215
3134
tests:
3235
- description: 'BulkWrite with string comment'
3336
runOnRequirements:
@@ -48,15 +51,15 @@ tests:
4851
- updateOne:
4952
filter: &updateOne_filter
5053
_id: 2
51-
update: &update { x: "updated" }
54+
update: &update { $set: {x: "updated"} }
5255
- deleteOne:
5356
filter: &deleteOne_filter
5457
_id: 3
5558
comment: &string_comment "comment"
5659
expectResult: &expect_results
5760
deletedCount: 1
5861
insertedCount: 1
59-
insertedIds: { 0: 5 }
62+
insertedIds: { $$unsetOrMatches: { 0: 5} }
6063
matchedCount: 2
6164
modifiedCount: 2
6265
upsertedCount: 0
@@ -92,6 +95,7 @@ tests:
9295
delete: *collection_name
9396
deletes:
9497
- q: *deleteOne_filter
98+
limit: 1
9599
ordered: true
96100
comment: *string_comment
97101
outcome: &outcome
@@ -148,6 +152,7 @@ tests:
148152
delete: *collection_name
149153
deletes:
150154
- q: *deleteOne_filter
155+
limit: 1
151156
ordered: true
152157
comment: *document_comment
153158
outcome: *outcome

spec/spec_tests/data/crud_unified/updateMany-comment.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ tests:
2929
object: *collection0
3030
arguments:
3131
filter: &filter { _id: 1 }
32-
update: &update
33-
- $set: { x: 22 }
32+
update: &update { $set: {x: 22} }
3433
comment: "comment"
3534
expectEvents:
3635
- client: *client0
@@ -42,6 +41,7 @@ tests:
4241
-
4342
q: *filter
4443
u: *update
44+
multi: true
4545
comment: "comment"
4646
outcome: &outcome
4747
- collectionName: *collection0Name
@@ -69,6 +69,7 @@ tests:
6969
-
7070
q: *filter
7171
u: *update
72+
multi: true
7273
comment: *comment
7374
outcome: *outcome
7475

@@ -94,5 +95,6 @@ tests:
9495
-
9596
q: *filter
9697
u: *update
98+
multi: true
9799
comment: "comment"
98100
outcome: *initialData

spec/spec_tests/data/crud_unified/updateOne-comment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ tests:
2929
object: *collection0
3030
arguments:
3131
filter: &filter { _id: 1 }
32-
update: &update { x: 22 }
32+
update: &update { $set: {x: 22} }
3333
comment: "comment"
3434
expectEvents:
3535
- client: *client0

0 commit comments

Comments
 (0)