Skip to content

Commit

Permalink
Fix pathStartsWith for tvOS
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl authored and Liquidsoul committed Aug 19, 2016
1 parent a31c5d4 commit 10ad179
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions OHHTTPStubs/Sources/Swift/OHHTTPStubsSwift.swift
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,11 @@ public func isPath(path: String) -> OHHTTPStubsTestBlock {
* should include in the `path` parameter unless you're testing relative URLs)
*/
public func pathStartsWith(path: String) -> OHHTTPStubsTestBlock {
#if os(tvOS)
return { req in req.url?.path?.hasPrefix(path) ?? false }
#else
return { req in req.url?.path.hasPrefix(path) ?? false }
#endif
}

/**
Expand Down

0 comments on commit 10ad179

Please sign in to comment.