Skip to content

Commit

Permalink
adds testConnectUsingMongoUrl and testGetMongoInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianconcept committed Feb 28, 2024
1 parent a4e6718 commit e63e99b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
31 changes: 31 additions & 0 deletions src/Mapless-Mongo-Tests/MaplessMongoAPITest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Class {
#name : #MaplessMongoAPITest,
#superclass : #MaplessTestCase,
#category : #'Mapless-Mongo-Tests-Tests'
}

{ #category : #tests }
MaplessMongoAPITest >> testConnectUsingMongoUrl [

| api mongoUrl |
api := MongoAPI mongoUrl: 'mongodb://localhost:27017/Mapless-Test'.
api open.
self assert: api isValid.
api close.
self deny: api isValid.
mongoUrl := ZnUrl fromString: 'mongodb://localhost:27017'.
self assert: api asMongoUrl equals: mongoUrl.

self assert: (api isAt: mongoUrl)
]

{ #category : #tests }
MaplessMongoAPITest >> testGetMongoInfo [

| api |
api := MongoAPI mongoUrl: 'mongodb://localhost:27017/Mapless-Test'.
api open.

self assert: api admin isMaster class equals: MongoIsMaster.
api close
]
2 changes: 1 addition & 1 deletion src/Mapless-Redis-Tests/MaplessRedisTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ MaplessRedisTest >> testUpdatingExpire [
found := repository findOne: SamplePerson atId: guy id.
self assert: found notNil.
repository expires: guy in: 900.
10 milliSeconds asDelay wait.
30 milliSeconds asDelay wait.
howMuchWillItBeThere := repository ttlFor: guy.
self assert: howMuchWillItBeThere > 0.
answer := repository expires: guy in: 2500.
Expand Down

0 comments on commit e63e99b

Please sign in to comment.