This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
osx_image: xcode9 | |
language: objective-c | |
cache: | |
- bundler | |
- cocoapods | |
script: | |
- xcodebuild clean test -quiet -workspace Foursquare\ Clone.xcworkspace -scheme Foursquare\ Clone -destination 'platform=iOS Simulator,name=iPhone 5s' | |
- bundle exec danger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
excluded: | |
- Carthage | |
- Pods |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "https://rubygems.org" | |
ruby '2.3.4' | |
gem 'danger-swiftlint' | |
gem 'cocoapods' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
osx_image: xcode9 | |
language: objective-c | |
cache: | |
- bundler | |
- cocoapods | |
script: | |
- xcodebuild clean test -quiet -workspace Foursquare\ Clone.xcworkspace -scheme Foursquare\ Clone -destination 'platform=iOS Simulator,name=iPhone 5s' | |
after_success: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
osx_image: xcode9 | |
language: objective-c | |
cache: | |
- bundler | |
- cocoapods | |
script: | |
- xcodebuild clean test -quiet -workspace Foursquare\ Clone.xcworkspace -scheme Foursquare\ Clone -destination 'platform=iOS Simulator,name=iPhone 5s' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func testDependencyDelegateShouldBeWrapperClass() { | |
let locationManager = container.resolve(LocationManager.self)! | |
let userLocationService: UserLocationService = container.resolve(UserLocationService.self)! | |
XCTAssertTrue(locationManager.delegate === userLocationService) | |
} | |
func testShouldRequestUserPermission() { | |
guard let locationManager = container.resolve(LocationManager.self)! as? LocationManagerMock else { | |
XCTFail("Error resolving container dependencies") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XCTest | |
import Swinject | |
class UserLocationServiceSpec: XCTestCase { | |
var container: Container! | |
override func setUp() { | |
super.setUp() | |
container = Container() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import CoreLocation | |
class LocationManagerMock: LocationManager { | |
var delegate: CLLocationManagerDelegate? | |
func requestWhenInUseAuthorization() {} | |
func requestLocation() {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Initial implementation of UserLocationService | |
class UserLocationService: NSObject { | |
fileprivate var locationManager: CLLocationManager | |
init(locationManager: CLLocationManager) { | |
self.locationManager = locationManager | |
super.init() | |
} | |
} |