Skip to content

Instantly share code, notes, and snippets.

Xavier Matos CalQL8ed-K-OS

Block or report user

Report or block CalQL8ed-K-OS

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@CalQL8ed-K-OS
CalQL8ed-K-OS / XCTExpectation.swift
Last active Mar 7, 2019 — forked from ole/XCTExpectation.swift
A variant of XCTKVOExpectation that works with native Swift key paths. To try it out, paste the code into an Xcode playground and observe the unit test output in the console. Based on Ole's blog post at https://oleb.net/blog/2018/02/xctkvoexpectation-swift-keypaths/, with a fix in the case that the condition on the expectation is already fulfilled.
View XCTExpectation.swift
import XCTest
/// An expectation that is fulfilled when a Key Value Observing (KVO) condition
/// is met. It's variant of `XCTKVOExpectation` with support for native Swift
/// key paths.
final class KVOExpectation: XCTestExpectation {
private var kvoToken: NSKeyValueObservation?
/// Creates an expectation that is fulfilled when a KVO change causes the
/// specified key path of the observed object to have an expected value.
View Playground .gitignore
xcuserdata/
*.xccheckout
View static dispatch in protocol extensions.playground
/*:
# response to [__Ghost of Swift Bugs Future__ by ALEXANDROS SALAZAR](http://nomothetis.svbtle.com/the-ghost-of-swift-bugs-future)
*/
protocol A {
func m1() -> String
}
extension A {
func m1() -> String {
@CalQL8ed-K-OS
CalQL8ed-K-OS / Template PR Description
Last active Dec 10, 2015
Template PR Description
View Template PR Description
[Story](<link to Story>)
<description of work>
### Dependencies
- [ ] <other PR and tasks>
### Reviews
- [ ] @<users you think should review this PR>
You can’t perform that action at this time.