Last active
July 27, 2019 16:26
-
-
Save LucianoPAlmeida/b28753bd86089676466b220bf0b11acc to your computer and use it in GitHub Desktop.
Quick and Nimble Testing
This file contains hidden or 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 Quick | |
import Nimble | |
@testable import FormulaOne | |
class TestPitStop: QuickSpec { | |
var car: Car? | |
var service: CarService = CarService() | |
override func spec() { | |
describe("A race pit stop") { | |
context("Given the vehicle stops in the pit after 15 laps", closure: { | |
beforeEach { | |
self.car = Car(tireLaps: 15, tyreCompound: .soft) | |
} | |
it("It should exit with new types", closure: { | |
self.service.changeTypes(compound: .hard, into: self.car) | |
expect(self.car.tireLaps).to(equal(0)) | |
expect(self.car.tyreCompound).to(equal(.hard)) | |
}) | |
afterEach { | |
self.car = nil | |
} | |
}) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment