Skip to content

Commit

Permalink
Revert "Update to latest issue reporting library"
Browse files Browse the repository at this point in the history
This reverts commit ad71962.
  • Loading branch information
klundberg committed Jul 25, 2024
1 parent ad71962 commit 3209238
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"pins" : [
{
"identity" : "swift-issue-reporting",
"identity" : "xctest-dynamic-overlay",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-issue-reporting.git",
"location" : "https://github.com/pointfreeco/xctest-dynamic-overlay.git",
"state" : {
"revision" : "357ca1e5dd31f613a1d43320870ebc219386a495",
"version" : "1.2.2"
"revision" : "23cbf2294e350076ea4dbd7d5d047c1e76b03631",
"version" : "1.0.2"
}
}
],
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ let package = Package(
],
dependencies: [
.package(
url: "https://github.com/pointfreeco/swift-issue-reporting",
url: "https://github.com/pointfreeco/xctest-dynamic-overlay.git",
"0.9.0"..<"2.0.0"
),
],
targets: [
.target(
name: "ComposableCoreLocation",
dependencies: [
.product(name: "IssueReporting", package: "swift-issue-reporting"),
.product(name: "XCTestDynamicOverlay", package: "xctest-dynamic-overlay"),
]
),
.testTarget(
Expand Down
24 changes: 12 additions & 12 deletions Sources/ComposableCoreLocation/Failing.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import Combine
import CoreLocation
import IssueReporting
import XCTestDynamicOverlay

extension LocationManager {
/// The failing implementation of the ``LocationManager`` interface. By default this
/// implementation stubs all of its endpoints as functions that immediately call `reportIssue`.
/// implementation stubs all of its endpoints as functions that immediately call `XCTFail`.
///
/// This allows you to test an even deeper property of your features: that they use only the
/// location manager endpoints that you specify and nothing else. This can be useful as a
Expand Down Expand Up @@ -39,43 +39,43 @@ extension LocationManager {
/// ```
public static let failing = Self(
accuracyAuthorization: {
reportIssue("A failing endpoint was accessed: 'LocationManager.accuracyAuthorization'")
XCTFail("A failing endpoint was accessed: 'LocationManager.accuracyAuthorization'")
return nil
},
authorizationStatus: {
reportIssue("A failing endpoint was accessed: 'LocationManager.authorizationStatus'")
XCTFail("A failing endpoint was accessed: 'LocationManager.authorizationStatus'")
return .notDetermined
},
delegate: { .unimplemented("LocationManager.delegate") },
dismissHeadingCalibrationDisplay: {
.unimplemented("LocationManager.dismissHeadingCalibrationDisplay")
},
heading: {
reportIssue("A failing endpoint was accessed: 'LocationManager.heading'")
XCTFail("A failing endpoint was accessed: 'LocationManager.heading'")
return nil
},
headingAvailable: {
reportIssue("A failing endpoint was accessed: 'LocationManager.headingAvailable'")
XCTFail("A failing endpoint was accessed: 'LocationManager.headingAvailable'")
return false
},
isRangingAvailable: {
reportIssue("A failing endpoint was accessed: 'LocationManager.isRangingAvailable'")
XCTFail("A failing endpoint was accessed: 'LocationManager.isRangingAvailable'")
return false
},
location: {
reportIssue("A failing endpoint was accessed: 'LocationManager.location'")
XCTFail("A failing endpoint was accessed: 'LocationManager.location'")
return nil
},
locationServicesEnabled: {
reportIssue("A failing endpoint was accessed: 'LocationManager.locationServicesEnabled'")
XCTFail("A failing endpoint was accessed: 'LocationManager.locationServicesEnabled'")
return false
},
maximumRegionMonitoringDistance: {
reportIssue("A failing endpoint was accessed: 'LocationManager.maximumRegionMonitoringDistance'")
XCTFail("A failing endpoint was accessed: 'LocationManager.maximumRegionMonitoringDistance'")
return CLLocationDistanceMax
},
monitoredRegions: {
reportIssue("A failing endpoint was accessed: 'LocationManager.monitoredRegions'")
XCTFail("A failing endpoint was accessed: 'LocationManager.monitoredRegions'")
return []
},
requestAlwaysAuthorization: { .unimplemented("LocationManager.requestAlwaysAuthorization") },
Expand All @@ -88,7 +88,7 @@ extension LocationManager {
},
set: { _ in .unimplemented("LocationManager.set") },
significantLocationChangeMonitoringAvailable: {
reportIssue()
XCTFail()
return false
},
startMonitoringForRegion: { _ in .unimplemented("LocationManager.startMonitoringForRegion") },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import Combine
import IssueReporting
import XCTestDynamicOverlay

extension AnyPublisher {
static func unimplemented(_ prefix: String, fileID: StaticString = #fileID, filePath: StaticString = #filePath, line: UInt = #line) -> Self {
static func unimplemented(_ prefix: String, file: StaticString = #file, line: UInt = #line) -> Self {
.fireAndForget {
reportIssue("\(prefix.isEmpty ? "" : "\(prefix) - ")An unimplemented publisher ran.", fileID: fileID, filePath: filePath, line: line)
XCTFail("\(prefix.isEmpty ? "" : "\(prefix) - ")An unimplemented publisher ran.", file: file, line: line)
}
}

Expand Down

0 comments on commit 3209238

Please sign in to comment.