Last active
November 27, 2017 16:29
-
-
Save SixFiveSoftware/983dffc14a9e0e0dfeeae7b723fe81d6 to your computer and use it in GitHub Desktop.
Xcode snippet for quickly filling out template quick/nimble test file. Assumes .fromNib() is an extension on UIViewController to instantiate it from nib.
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>IDECodeSnippetCompletionPrefix</key> | |
<string>vctest</string> | |
<key>IDECodeSnippetCompletionScopes</key> | |
<array> | |
<string>TopLevel</string> | |
</array> | |
<key>IDECodeSnippetContents</key> | |
<string>import UIKit | |
@testable import POS_Debug | |
import AcmeCore | |
import Quick | |
import Nimble | |
class <#ViewControllerName#>Tests: QuickSpec { | |
var sut: <#ViewControllerName#>! | |
override func spec() { | |
beforeEach { | |
self.sut = <#ViewControllerName#>.fromNib() | |
_ = self.sut.view | |
} | |
describe("<#ViewControllerName#>") { | |
context("outlets") { | |
it("has connected <#OutletName#>") { expect(self.sut.<#OutletName#>).toNot(beNil()) } | |
} | |
context("<#OutletName#> actions list") { | |
it("contains <#MethodName#> action") { | |
let actions = self.sut.<#OutletName#>.actions(forTarget: self.sut, forControlEvent: .touchUpInside) ?? [] | |
expect(actions).to(contain("<#MethodName#>:")) | |
} | |
} | |
} | |
} | |
}</string> | |
<key>IDECodeSnippetIdentifier</key> | |
<string>5B3EA31E-E51F-4939-B09F-24EED4B1CC7F</string> | |
<key>IDECodeSnippetLanguage</key> | |
<string>Xcode.SourceCodeLanguage.Swift</string> | |
<key>IDECodeSnippetSummary</key> | |
<string>Stubbed test starter template for View Controllers.</string> | |
<key>IDECodeSnippetTitle</key> | |
<string>View Controller Spec Template</string> | |
<key>IDECodeSnippetUserSnippet</key> | |
<true/> | |
<key>IDECodeSnippetVersion</key> | |
<integer>2</integer> | |
</dict> | |
</plist> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment