From e362d93ee121a06c67048c22d092134848bb1d19 Mon Sep 17 00:00:00 2001 From: Diogo Autilio Date: Tue, 12 Sep 2023 06:36:59 -0300 Subject: [PATCH] Small improvemets related to Realm and unit tests with Realm --- SWDestinyTrades/Classes/Database/RealmDatabase.swift | 2 +- .../Screens/PeopleList/PeopleListViewControllerTests.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SWDestinyTrades/Classes/Database/RealmDatabase.swift b/SWDestinyTrades/Classes/Database/RealmDatabase.swift index 5f6a0453..e960ceaf 100644 --- a/SWDestinyTrades/Classes/Database/RealmDatabase.swift +++ b/SWDestinyTrades/Classes/Database/RealmDatabase.swift @@ -70,7 +70,7 @@ final class RealmDatabase: DatabaseProtocol { } } - static func realHomeDirectory() -> String { + private static func realHomeDirectory() -> String { let homeDirectory = NSHomeDirectory() let pathComponents = homeDirectory.components(separatedBy: "/") return "/\(pathComponents[1])/\(pathComponents[2])" diff --git a/SWDestinyTradesTests/SnapShots/Screens/PeopleList/PeopleListViewControllerTests.swift b/SWDestinyTradesTests/SnapShots/Screens/PeopleList/PeopleListViewControllerTests.swift index a7924372..4b5984bd 100644 --- a/SWDestinyTradesTests/SnapShots/Screens/PeopleList/PeopleListViewControllerTests.swift +++ b/SWDestinyTradesTests/SnapShots/Screens/PeopleList/PeopleListViewControllerTests.swift @@ -31,7 +31,7 @@ final class PeopleListViewControllerTests: QuickSpec { context("when it's initialized from the tabbar") { beforeEach { - try! database = RealmDatabase(configuration: .inMemory(identifier: "PeopleListViewControllerTests")) + database = RealmDatabaseHelper.createMemoryDatabase(identifier: "PeopleList") } afterEach {