-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Lower iOS and tvOS to 9.0, closes #16 - Correct SPM platforms and make consistent with podspec, closes #18 This also separates tests into `ObservationTests`, which we can mark as `@available` so that building/running via SPM works.
- Loading branch information
1 parent
436d0a2
commit dd07c2a
Showing
7 changed files
with
66 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// | ||
// Created by Jesse Squires | ||
// https://www.jessesquires.com | ||
// | ||
// Documentation | ||
// https://jessesquires.github.io/Foil | ||
// | ||
// GitHub | ||
// https://github.com/jessesquires/Foil | ||
// | ||
// Copyright © 2021-present Jesse Squires | ||
// | ||
|
||
import Combine | ||
@testable import Foil | ||
import XCTest | ||
|
||
@available(iOS 13.0, watchOS 6.0, tvOS 13.0, macOS 10.15, *) | ||
final class ObservationTests: XCTestCase { | ||
|
||
let settings = TestSettings() | ||
var cancellable = Set<AnyCancellable>() | ||
|
||
func test_Integration_Publisher() { | ||
let promise = expectation(description: #function) | ||
var publishedValue: String? | ||
|
||
settings | ||
.publisher(for: \.nickname, options: [.new]) | ||
.sink { | ||
publishedValue = $0 | ||
promise.fulfill() | ||
} | ||
.store(in: &cancellable) | ||
|
||
settings.nickname = "abc123" | ||
wait(for: [promise], timeout: 5) | ||
|
||
XCTAssertEqual(settings.nickname, publishedValue) | ||
} | ||
} |