Slide 20
Slide 20 text
import UIKit
import Quick
import Nimble
import Nimble_Snapshots
@testable import ScreenShotExample
final class ViewControllerSpec: QuickSpec {
override func spec() {
describe("view") {
var subject: ViewController!
var window: UIWindow!
beforeEach {
window = UIWindow()
let bundle = Bundle.main
let storyboard = UIStoryboard(name: "Main", bundle: bundle)
subject = storyboard.instantiateViewController(withIdentifier: "ViewController")
as! ViewController
window.addSubview(subject.view)
RunLoop.current.run(until: Date())
}
afterEach {
window = nil
}
it("displays correctly") {
(subject)
// expect(subject).toEventually(haveValidSnapshot())
}
}
}
ʩ