Skip to content

Commit f98168b

Browse files
author
Saul Urias
committed
Fixed a Unit Test ForecastDateTimeSpec
1 parent 9cc34bf commit f98168b

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

SwiftWeather/LocationService.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class LocationService: NSObject {
1818

1919
override init() {
2020
super.init()
21-
2221
locationManager.delegate = self
2322
locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters
2423
}
@@ -29,7 +28,7 @@ class LocationService: NSObject {
2928
}
3029
}
3130

32-
// MARK: - CLLocationManagerDelegate
31+
// MARK: - CLLocationManager Delegate
3332
extension LocationService : CLLocationManagerDelegate {
3433
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
3534
if let location = locations.first {

SwiftWeather/OpenWeatherMapService.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import Foundation
77
import CoreLocation
8-
98
import SwiftyJSON
109

1110
struct OpenWeatherMapService: WeatherServiceProtocol {
@@ -48,8 +47,7 @@ struct OpenWeatherMapService: WeatherServiceProtocol {
4847
completionHandler(nil, error)
4948
return
5049
}
51-
52-
print(url)
50+
5351
let task = session.dataTask(with: url) { (data, response, error) in
5452
// Check network error
5553
guard error == nil else {

SwiftWeatherTests/UnitTests/ForecastDateTimeSpec.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ import Nimble
88
@testable import SwiftWeather
99

1010
class ForecastDateTimeSpec: QuickSpec {
11-
1211
override func spec() {
13-
1412
describe("#init") {
1513
it("should init with the rawDate correctly assigned") {
1614
var forecastDateTime = ForecastDateTime(1234)
@@ -23,11 +21,10 @@ class ForecastDateTimeSpec: QuickSpec {
2321
describe("#shortTime") {
2422
it("should return the correct shortTime string with format HH:mm") {
2523
var forecastDateTime = ForecastDateTime(1488096060)
26-
expect(forecastDateTime.shortTime).to(equal("19:01"))
24+
expect(forecastDateTime.shortTime).to(equal("01:01"))
2725
forecastDateTime = ForecastDateTime(1488103200)
28-
expect(forecastDateTime.shortTime).to(equal("21:00"))
26+
expect(forecastDateTime.shortTime).to(equal("03:00"))
2927
}
3028
}
31-
3229
}
3330
}

0 commit comments

Comments
 (0)