Skip to content

Instantly share code, notes, and snippets.

View thiagolioy's full-sized avatar

Thiago Lioy thiagolioy

View GitHub Profile
@thiagolioy
thiagolioy / CharacterSpec.swift
Created November 27, 2016 20:09
Blog post about tests
import Quick
import Nimble
@testable import Marvel
class CharacterSpec: QuickSpec {
override func spec() {
describe("a character") {
var character: Marvel.Character!
@thiagolioy
thiagolioy / CharactersViewControllerSpec.swift
Created November 27, 2016 20:23
Post about tests on the blog
import Quick
import Nimble
@testable import Marvel
struct MarvelAPICallsMock: MarvelAPICalls {
let characters: [Marvel.Character]
func characters(query: String? = nil, completion: @escaping ([Marvel.Character]?) -> Void) {
completion(characters)
}
import Foundation
import Quick
import Nimble
@testable import Marvel
class CharactersDatasourceSpec: QuickSpec {
override func spec() {
describe("CharactersDatasource") {
import Foundation
import Quick
import Nimble
@testable import Marvel
class CharactersDelegateMock: CharactersDelegate {
var didSelectRowTrigged = false
func didSelectCharacter(at index: IndexPath) {
# Sometimes it's a README fix, or something like that - which isn't relevant for
# including in a project's CHANGELOG for example
declared_trivial = github.pr_title.include? "#trivial"
# Make it more obvious that a PR is a work in progress and shouldn't be merged yet
warn("PR is classed as Work in Progress") if github.pr_title.include? "[WIP]"
# Warn when there is a big PR
warn("Big PR") if git.lines_of_code > 500
@thiagolioy
thiagolioy / .travis.yml
Last active December 7, 2016 17:38
.travis.yml
language: objective-c
osx_image: xcode8.1
cache:
- bundler
- cocoapods
before_install:
- bundle install
- bundle exec pod keys set MarvelApiKey $MARVEL_API_SECRET Marvel
- bundle exec pod keys set MarvelPrivateKey $MARVEL_API_PUBLIC Marvel
- pod repo update
import UIKit
import Reusable
import UIKit
final class CharacterTableCell: UITableViewCell {
var characterRow = CharacterRowView()
static func height() -> CGFloat {
return 80
}
//
// CharacterTableCell.swift
// Marvel
//
// Created by Thiago Lioy on 15/11/16.
// Copyright © 2016 Thiago Lioy. All rights reserved.
//
import UIKit
import Reusable
import Foundation
protocol ViewConfiguration: class {
func setupConstraints()
func buildViewHierarchy()
func configureViews()
}
import UIKit
final class CharacterViewController: UIViewController {
var characterView = CharacterView()
var character: Character?
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
}