-
Notifications
You must be signed in to change notification settings - Fork 1
/
Tests.swift
39 lines (32 loc) · 1.06 KB
/
Tests.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Built by Manuel @StuFFmc Carrasco Molina on New year's Eve 2021 / January 2022
import XCTest
@testable import Alby
class AlbyTests: XCTestCase {
override func setUpWithError() throws {
}
override func tearDownWithError() throws {
}
func testHasAtLeastOneBrowser() throws {
XCTAssert(Browser.installed.count > 0)
}
func testInstall() throws {
XCTAssert(Browser.installed.count > 0)
if let browser = Browser.installed.first {
if albyJsonExist(for: browser) {
try! FileManager.default.removeItem(at: browser.albyJsonURL)
}
try browser.installOrRemove()
XCTAssertTrue(albyJsonExist(for: browser))
try browser.installOrRemove()
XCTAssertFalse(albyJsonExist(for: browser))
}
}
private func albyJsonExist(for browser: Browser) -> Bool {
FileManager.default.fileExists(atPath: browser.albyJsonURL.path)
}
func testPerformanceExample() throws {
measure {
_ = Browser.all
}
}
}