Skip to content

Instantly share code, notes, and snippets.

func testDecodingArrayWithPassengerDeliverySucceeds() throws {
let givenJsonData = #"""
[
{
"food": {
"date": "2020-01-01",
"restaurantName": "Restaurant",
"totalCost": "8.00",
"orders": [
{
func testDecodingFoodDeliveryWithoutRestaurantThrowsAnError() throws {
let givenJsonData = #"""
[
{
"food": {
"date": "2020-01-01",
"totalCost": "8.00",
"orders": [
{
"name": "Pizza",
func testDecodingUnknownOrderItemsThrowsAnError() throws {
let givenJsonData = #"""
[
"unknownDelivery": "unknownValue"
]
"""#.data(using: .utf8)!
XCTAssertThrowsError(try decoder.decode([OrderItem].self, from: givenJsonData))
}
@tedgonzalez
tedgonzalez / config.yml
Created January 5, 2020 16:34
Cache cocoapods when using circleci
- restore_cache:
key: 1-pods-{{ checksum "Podfile.lock" }}
- run:
name: Install CocoaPods
command: |
if [ ! -d "Pods" ]
then
curl https://cocoapods-specs.circleci.com/fetch-cocoapods-repo-from-s3.sh | bash -s cf
bundle exec pod install
fi