@@ -29,8 +29,8 @@ fn create_delete_scopes_collections() {
29
29
assert ! ( db. scope( DEFAULT_NAME . to_string( ) ) . unwrap( ) . is_some( ) ) ;
30
30
assert ! ( db. scope( unknown. clone( ) ) . unwrap( ) . is_none( ) ) ;
31
31
assert_eq ! (
32
- db. default_scope( ) . unwrap( ) ,
33
- db. scope( DEFAULT_NAME . to_string( ) ) . unwrap( ) . unwrap( )
32
+ db. default_scope( ) . unwrap( ) . name ( ) ,
33
+ db. scope( DEFAULT_NAME . to_string( ) ) . unwrap( ) . unwrap( ) . name ( )
34
34
) ;
35
35
36
36
// Get collection
@@ -46,10 +46,11 @@ fn create_delete_scopes_collections() {
46
46
. collection( DEFAULT_NAME . to_string( ) , unknown. clone( ) )
47
47
. is_err( ) ) ; // Invalid scope => Err
48
48
assert_eq ! (
49
- db. default_collection( ) . unwrap( ) . unwrap( ) ,
49
+ db. default_collection( ) . unwrap( ) . unwrap( ) . name ( ) ,
50
50
db. collection( DEFAULT_NAME . to_string( ) , DEFAULT_NAME . to_string( ) )
51
51
. unwrap( )
52
52
. unwrap( )
53
+ . name( )
53
54
) ;
54
55
55
56
// Add collection in default scope
@@ -61,13 +62,15 @@ fn create_delete_scopes_collections() {
61
62
assert_eq ! (
62
63
db. collection( new_collection_1. clone( ) , DEFAULT_NAME . to_string( ) )
63
64
. unwrap( )
64
- . unwrap( ) ,
65
- c1_default_scope
65
+ . unwrap( )
66
+ . name( ) ,
67
+ c1_default_scope. name( )
66
68
) ;
67
69
assert_eq ! (
68
70
db. create_collection( new_collection_1. clone( ) , DEFAULT_NAME . to_string( ) )
69
- . unwrap( ) ,
70
- c1_default_scope
71
+ . unwrap( )
72
+ . name( ) ,
73
+ c1_default_scope. name( )
71
74
) ;
72
75
73
76
assert_eq ! (
@@ -85,13 +88,15 @@ fn create_delete_scopes_collections() {
85
88
assert_eq ! (
86
89
db. collection( new_collection_2. clone( ) , new_scope. clone( ) )
87
90
. unwrap( )
88
- . unwrap( ) ,
89
- c2_new_scope
91
+ . unwrap( )
92
+ . name( ) ,
93
+ c2_new_scope. name( )
90
94
) ;
91
95
assert_eq ! (
92
96
db. create_collection( new_collection_2. clone( ) , new_scope. clone( ) )
93
- . unwrap( ) ,
94
- c2_new_scope
97
+ . unwrap( )
98
+ . name( ) ,
99
+ c2_new_scope. name( )
95
100
) ;
96
101
97
102
assert_eq ! (
@@ -158,8 +163,9 @@ fn collections_accessors() {
158
163
assert_eq ! (
159
164
db. collection( new_collection_1. clone( ) , DEFAULT_NAME . to_string( ) )
160
165
. unwrap( )
161
- . unwrap( ) ,
162
- c1_default_scope
166
+ . unwrap( )
167
+ . name( ) ,
168
+ c1_default_scope. name( )
163
169
) ;
164
170
165
171
let c2_new_scope = db
@@ -168,8 +174,9 @@ fn collections_accessors() {
168
174
assert_eq ! (
169
175
db. collection( new_collection_2. clone( ) , new_scope. clone( ) )
170
176
. unwrap( )
171
- . unwrap( ) ,
172
- c2_new_scope
177
+ . unwrap( )
178
+ . name( ) ,
179
+ c2_new_scope. name( )
173
180
) ;
174
181
175
182
let c1_new_scope = db
@@ -178,17 +185,18 @@ fn collections_accessors() {
178
185
assert_eq ! (
179
186
db. collection( new_collection_1. clone( ) , new_scope. clone( ) )
180
187
. unwrap( )
181
- . unwrap( ) ,
182
- c1_new_scope
188
+ . unwrap( )
189
+ . name( ) ,
190
+ c1_new_scope. name( )
183
191
) ;
184
192
185
193
let default_scope = db. scope ( DEFAULT_NAME . to_string ( ) ) . unwrap ( ) . unwrap ( ) ;
186
194
let new_actual_scope = db. scope ( new_scope. clone ( ) ) . unwrap ( ) . unwrap ( ) ;
187
195
188
196
// Scope
189
- assert_eq ! ( c1_default_scope. scope( ) , default_scope) ;
190
- assert_eq ! ( c2_new_scope. scope( ) , new_actual_scope) ;
191
- assert_eq ! ( c1_new_scope. scope( ) , new_actual_scope) ;
197
+ assert_eq ! ( c1_default_scope. scope( ) . name ( ) , default_scope. name ( ) ) ;
198
+ assert_eq ! ( c2_new_scope. scope( ) . name ( ) , new_actual_scope. name ( ) ) ;
199
+ assert_eq ! ( c1_new_scope. scope( ) . name ( ) , new_actual_scope. name ( ) ) ;
192
200
193
201
// Name
194
202
assert_eq ! ( c1_default_scope. name( ) , new_collection_1. clone( ) ) ;
@@ -216,8 +224,9 @@ fn scope_accessors() {
216
224
assert_eq ! (
217
225
db. collection( new_collection_1. clone( ) , DEFAULT_NAME . to_string( ) )
218
226
. unwrap( )
219
- . unwrap( ) ,
220
- c1_default_scope
227
+ . unwrap( )
228
+ . name( ) ,
229
+ c1_default_scope. name( )
221
230
) ;
222
231
223
232
let c2_new_scope = db
@@ -226,8 +235,9 @@ fn scope_accessors() {
226
235
assert_eq ! (
227
236
db. collection( new_collection_2. clone( ) , new_scope. clone( ) )
228
237
. unwrap( )
229
- . unwrap( ) ,
230
- c2_new_scope
238
+ . unwrap( )
239
+ . name( ) ,
240
+ c2_new_scope. name( )
231
241
) ;
232
242
233
243
let c1_new_scope = db
@@ -236,8 +246,9 @@ fn scope_accessors() {
236
246
assert_eq ! (
237
247
db. collection( new_collection_1. clone( ) , new_scope. clone( ) )
238
248
. unwrap( )
239
- . unwrap( ) ,
240
- c1_new_scope
249
+ . unwrap( )
250
+ . name( ) ,
251
+ c1_new_scope. name( )
241
252
) ;
242
253
243
254
let default_scope = db. scope ( DEFAULT_NAME . to_string ( ) ) . unwrap ( ) . unwrap ( ) ;
@@ -266,22 +277,25 @@ fn scope_accessors() {
266
277
default_scope
267
278
. collection( new_collection_1. clone( ) )
268
279
. unwrap( )
269
- . unwrap( ) ,
270
- c1_default_scope
280
+ . unwrap( )
281
+ . name( ) ,
282
+ c1_default_scope. name( )
271
283
) ;
272
284
assert_eq ! (
273
285
new_actual_scope
274
286
. collection( new_collection_2. clone( ) )
275
287
. unwrap( )
276
- . unwrap( ) ,
277
- c2_new_scope
288
+ . unwrap( )
289
+ . name( ) ,
290
+ c2_new_scope. name( )
278
291
) ;
279
292
assert_eq ! (
280
293
new_actual_scope
281
294
. collection( new_collection_1. clone( ) )
282
295
. unwrap( )
283
- . unwrap( ) ,
284
- c1_new_scope
296
+ . unwrap( )
297
+ . name( ) ,
298
+ c1_new_scope. name( )
285
299
) ;
286
300
} ) ;
287
301
}
0 commit comments