Skip to content

Commit

Permalink
Move TestableTrakt to TraktSwiftTestable framework
Browse files Browse the repository at this point in the history
  • Loading branch information
Pietro Caselani committed Jan 8, 2020
1 parent 22a0d09 commit 2eda35f
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
import Moya
@testable import TraktSwift
import Moya

public class TestableTrakt: Trakt {
override public func createProvider<T>(forTarget target: T.Type) -> MoyaProvider<T> where T: TraktType {
public override init(builder: TraktBuilder) {
super.init(builder: builder)
}

public convenience init() {
self.init(builder: TraktBuilder(buildClosure: {
$0.clientId = "fakeClientId"
$0.clientSecret = "fakeClientSecret"
}))
}

override public func createProvider<T>(forTarget target: T.Type) -> MoyaProvider<T> where T: TraktType {
let provider = super.createProvider(forTarget: target)

return MoyaProvider(endpointClosure: provider.endpointClosure,
Expand Down

0 comments on commit 2eda35f

Please sign in to comment.