Skip to content

Commit

Permalink
Merge pull request #55 from rheinfabrik/feature/circle-ci
Browse files Browse the repository at this point in the history
Circle CI
  • Loading branch information
DerLobi committed May 13, 2015
2 parents 45f871e + de5a77a commit e353fcc
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 33 deletions.
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "LlamaKit/LlamaKit" ~> 0.5
github "thoughtbot/Argo" ~> 0.3
github "kishikawakatsumi/KeychainAccess" ~> 1.1
github "LlamaKit/LlamaKit" ~> 0.6
github "thoughtbot/Argo" ~> 0.4
github "kishikawakatsumi/KeychainAccess" ~> 1.2
4 changes: 2 additions & 2 deletions Cartfile.private
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "Quick/Quick" ~> 0.2
github "Quick/Nimble" ~> 0.3
github "Quick/Quick" ~> 0.3
github "Quick/Nimble" ~> 0.4
github "AliSoftware/OHHTTPStubs" "8f0f04866a2ffa1309527dd228151bba68b7fbae"
12 changes: 6 additions & 6 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github "kishikawakatsumi/KeychainAccess" "v1.1.3"
github "LlamaKit/LlamaKit" "v0.5.0"
github "Quick/Nimble" "v0.3.1"
github "kishikawakatsumi/KeychainAccess" "v1.2.0"
github "LlamaKit/LlamaKit" "v0.6.0"
github "Quick/Nimble" "v0.4.2"
github "AliSoftware/OHHTTPStubs" "8f0f04866a2ffa1309527dd228151bba68b7fbae"
github "Quick/Quick" "v0.2.2"
github "thoughtbot/runes" "v1.1.1"
github "thoughtbot/Argo" "v0.3.4"
github "Quick/Quick" "v0.3.1"
github "thoughtbot/runes" "v1.2.2"
github "thoughtbot/Argo" "v0.4.3"
2 changes: 1 addition & 1 deletion Heimdall/Heimdall.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public class Heimdall {
httpClient.sendRequest(request) { data, response, error in
if let error = error {
completion(failure(error))
} else if (response as NSHTTPURLResponse).statusCode == 200 {
} else if (response as! NSHTTPURLResponse).statusCode == 200 {
if let accessToken = OAuthAccessToken.decode(data) {
self.accessToken = accessToken
completion(success(accessToken))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class HeimdallResourceRequestAuthenticatorHTTPAuthorizationHeader: Heimda
///
/// :returns: The authenticated request.
public func authenticateResourceRequest(request: NSURLRequest, accessToken: OAuthAccessToken) -> NSURLRequest {
var mutableRequest = request.mutableCopy() as NSMutableURLRequest
var mutableRequest = request.mutableCopy() as! NSMutableURLRequest
mutableRequest.setHTTPAuthorization(.AccessTokenAuthentication(accessToken))
return mutableRequest
}
Expand Down
22 changes: 11 additions & 11 deletions HeimdallTests/HeimdallSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class OAuthAccessTokenMockStore: OAuthAccessTokenStore {

class HeimdallResourceRequestMockAuthenticator: HeimdallResourceRequestAuthenticator {
func authenticateResourceRequest(request: NSURLRequest, accessToken: OAuthAccessToken) -> NSURLRequest {
var mutableRequest = request.mutableCopy() as NSMutableURLRequest
var mutableRequest = request.mutableCopy() as! NSMutableURLRequest
mutableRequest.addValue("totally", forHTTPHeaderField: "MockAuthorized")
return mutableRequest
}
Expand Down Expand Up @@ -94,7 +94,7 @@ class HeimdallSpec: QuickSpec {

beforeEach {
OHHTTPStubs.stubRequestsPassingTest({ request in
return (request.URL.absoluteString! == "http://rheinfabrik.de")
return (request.URL!.absoluteString! == "http://rheinfabrik.de")
}, withStubResponse: { request in
return OHHTTPStubsResponse(data: NSData(contentsOfFile: self.bundle.pathForResource("authorize-valid", ofType: "json")!), statusCode: 200, headers: [ "Content-Type": "application/json" ])
})
Expand Down Expand Up @@ -126,7 +126,7 @@ class HeimdallSpec: QuickSpec {

beforeEach {
OHHTTPStubs.stubRequestsPassingTest({ request in
return (request.URL.absoluteString! == "http://rheinfabrik.de")
return (request.URL!.absoluteString! == "http://rheinfabrik.de")
}, withStubResponse: { request in
return OHHTTPStubsResponse(data: NSData(contentsOfFile: self.bundle.pathForResource("authorize-error", ofType: "json")!), statusCode: 400, headers: nil)
})
Expand Down Expand Up @@ -162,7 +162,7 @@ class HeimdallSpec: QuickSpec {

beforeEach {
OHHTTPStubs.stubRequestsPassingTest({ request in
return (request.URL.absoluteString! == "http://rheinfabrik.de")
return (request.URL!.absoluteString! == "http://rheinfabrik.de")
}, withStubResponse: { request in
return OHHTTPStubsResponse(data: NSData(contentsOfFile: self.bundle.pathForResource("authorize-invalid", ofType: "json")!), statusCode: 200, headers: [ "Content-Type": "application/json" ])
})
Expand Down Expand Up @@ -197,7 +197,7 @@ class HeimdallSpec: QuickSpec {

beforeEach {
OHHTTPStubs.stubRequestsPassingTest({ request in
return (request.URL.absoluteString! == "http://rheinfabrik.de")
return (request.URL!.absoluteString! == "http://rheinfabrik.de")
}, withStubResponse: { request in
return OHHTTPStubsResponse(data: NSData(contentsOfFile: self.bundle.pathForResource("authorize-invalid-token", ofType: "json")!), statusCode: 200, headers: [ "Content-Type": "application/json" ])
})
Expand Down Expand Up @@ -233,7 +233,7 @@ class HeimdallSpec: QuickSpec {

beforeEach {
OHHTTPStubs.stubRequestsPassingTest({ request in
return (request.URL.absoluteString! == "http://rheinfabrik.de")
return (request.URL!.absoluteString! == "http://rheinfabrik.de")
}, withStubResponse: { request in
return OHHTTPStubsResponse(data: NSData(contentsOfFile: self.bundle.pathForResource("authorize-invalid-type", ofType: "json")!), statusCode: 200, headers: [ "Content-Type": "application/json" ])
})
Expand Down Expand Up @@ -302,7 +302,7 @@ class HeimdallSpec: QuickSpec {

beforeEach {
OHHTTPStubs.stubRequestsPassingTest({ request in
return (request.URL.absoluteString! == "http://rheinfabrik.de")
return (request.URL!.absoluteString! == "http://rheinfabrik.de")
}, withStubResponse: { request in
return OHHTTPStubsResponse(data: NSData(contentsOfFile: self.bundle.pathForResource("request-valid", ofType: "json")!), statusCode: 200, headers: [ "Content-Type": "application/json" ])
})
Expand Down Expand Up @@ -334,7 +334,7 @@ class HeimdallSpec: QuickSpec {

beforeEach {
OHHTTPStubs.stubRequestsPassingTest({ request in
return (request.URL.absoluteString! == "http://rheinfabrik.de")
return (request.URL!.absoluteString! == "http://rheinfabrik.de")
}, withStubResponse: { request in
return OHHTTPStubsResponse(data: NSData(contentsOfFile: self.bundle.pathForResource("request-invalid-norefresh", ofType: "json")!), statusCode: 200, headers: [ "Content-Type": "application/json" ])
})
Expand Down Expand Up @@ -371,7 +371,7 @@ class HeimdallSpec: QuickSpec {
beforeEach {
OHHTTPStubs.stubRequestsPassingTest({ request in
return (
request.URL.absoluteString! == "http://rheinfabrik.de"
request.URL!.absoluteString! == "http://rheinfabrik.de"
&& heimdall.hasAccessToken == false
)
}, withStubResponse: { request in
Expand All @@ -391,7 +391,7 @@ class HeimdallSpec: QuickSpec {

beforeEach {
OHHTTPStubs.stubRequestsPassingTest({ request in
return (request.URL.absoluteString! == "http://rheinfabrik.de")
return (request.URL!.absoluteString! == "http://rheinfabrik.de")
}, withStubResponse: { request in
return OHHTTPStubsResponse(data: NSData(contentsOfFile: self.bundle.pathForResource("request-valid", ofType: "json")!), statusCode: 200, headers: [ "Content-Type": "application/json" ])
})
Expand All @@ -415,7 +415,7 @@ class HeimdallSpec: QuickSpec {

beforeEach {
OHHTTPStubs.stubRequestsPassingTest({ request in
return (request.URL.absoluteString! == "http://rheinfabrik.de")
return (request.URL!.absoluteString! == "http://rheinfabrik.de")
}, withStubResponse: { request in
return OHHTTPStubsResponse(data: NSData(contentsOfFile: self.bundle.pathForResource("authorize-error", ofType: "json")!), statusCode: 400, headers: [ "Content-Type": "application/json" ])
})
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Heimdall is an [OAuth 2.0](https://tools.ietf.org/html/rfc6749) client specifica

If you are familiar with [ReactiveCocoa](https://github.com/ReactiveCocoa/ReactiveCocoa), also check out [ReactiveHeimdall](https://github.com/rheinfabrik/ReactiveHeimdall)!

[![Build Status](https://travis-ci.org/rheinfabrik/Heimdall.swift.svg)](https://travis-ci.org/rheinfabrik/Heimdall.swift)
[![Build Status](https://circleci.com/gh/rheinfabrik/Heimdall.swift.svg?style=shield&circle-token=06d0c39133fae3dd9b649c116776c7f882885f1f)](https://circleci.com/gh/rheinfabrik/Heimdall.swift)

## Example

Expand Down
10 changes: 10 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
machine:
xcode:
version: "6.3.1"
dependencies:
pre:
- sudo chown :wheel /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ *.simruntime/Contents/Resources/RuntimeRoot/usr/lib/dyld_sim
- brew install carthage
test:
override:
- scripts/cibuild

0 comments on commit e353fcc

Please sign in to comment.