Skip to content

Commit

Permalink
Fix a test which did not test what it intended to test
Browse files Browse the repository at this point in the history
  • Loading branch information
tgoyne committed Jul 1, 2022
1 parent 13cdd52 commit b985477
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions RealmSwift/Tests/CombineTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ class CombinePublisherTestCase: TestCase {
override func setUp() {
super.setUp()
realm = try! Realm(configuration: Realm.Configuration(inMemoryIdentifier: "test"))
XCTAssertTrue(realm.isEmpty)
}

override func tearDown() {
Expand Down Expand Up @@ -2775,9 +2776,7 @@ class CombineProjectionPublisherTests: CombinePublisherTestCase {
class CombineAsyncRealmTests: CombinePublisherTestCase {
func testWillChangeLocalWrite() {
let asyncWriteExpectation = expectation(description: "Should complete async write")
cancellable = realm
.objectWillChange
.sink {
cancellable = realm.objectWillChange.sink {
asyncWriteExpectation.fulfill()
}

Expand All @@ -2792,8 +2791,8 @@ class CombineAsyncRealmTests: CombinePublisherTestCase {
cancellable = realm.objectWillChange.sink {
exp.fulfill()
}
DispatchQueue.main.async {
let realm = try! Realm(configuration: self.realm.configuration)
queue.async {
let realm = try! Realm(configuration: self.realm.configuration, queue: self.queue)
realm.writeAsync {
realm.create(SwiftIntObject.self, value: [])
}
Expand Down

0 comments on commit b985477

Please sign in to comment.