Latest 1.1.0
Homepage https://github.com/ZachOrr/TBAKit
License MIT
Platforms ios 10.0
Dependencies TBAKit
Frameworks XCTest

TBAKit

CI Status
codecov
Version
License
Platform

Installation

TBAKit is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "TBAKit"

To get an API key for The Blue Alliance API you can generate one on The Blue Alliance’s Account Dashboard

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Set up a TBAKit instance (or use the singleton) to make an API call

func fetchStatusSingleton() {
    TBAKit.sharedKit.apiKey = "abc123"
    let task = TBAKit.sharedKit.fetchStatus { (status, error) in
        if let error = error {
            print(error)
            return
        }
        print(status)
    }
}

func fetchStatusInstance() {
    let kit = TBAKit(apiKey: "abc123")
    let task = kit.fetchStatus { (status, error) in
        if let error = error {
            print(error)
            return
        }
        print(status)
    }
}

Adding Tests

If you’d like to modify or add a test, the local testing files are in the data directory. The local testing files are static JSON responses from API endpoints that are sent to the mocked requests. To name the file, modify the API endpoint name by replacing slashes with underscores and making sure the file is a .json

URL => https://www.thebluealliance.com/api/v3/team/frc2337/event/2016micmp/status
Filename => team_frc2337_event_2016micmp_status

License

TBAKit is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "TBAKitTesting",
    "version": "1.1.0",
    "summary": "Helper classes for testing/mocking TBAKit",
    "homepage": "https://github.com/ZachOrr/TBAKit",
    "license": {
        "type": "MIT",
        "file": "LICENSE.md"
    },
    "authors": "ZachOrr",
    "source": {
        "git": "https://github.com/ZachOrr/TBAKit.git",
        "tag": "testing/1.1.0"
    },
    "platforms": {
        "ios": "10.0"
    },
    "source_files": "Testing/**",
    "frameworks": "XCTest",
    "dependencies": {
        "TBAKit": []
    }
}

Pin It on Pinterest

Share This