目录
目录README.md

Yarn

Boolean Expectations

Usage

import Yarn

Example

func someFunction() throws -> Bool {
    true
}

Yarn.expectFunctionToReturnTrue(someFunction)
Yarn.expectClosureToReturnFalse {
    false
}

Example Output

5/9/21, 10:02 AM [yarn.console.log.expectation] ✅: expectFunctionToReturnTrue
5/9/21, 10:02 AM [yarn.console.log.expectation] ❌: expectClosureToReturnFalse

Example Error

func someThrowingFunction() throws -> Bool {
    throw Yarn.SomeError.expectedError
}

Yarn.expectFunctionToThrowAnError(someThrowingFunction)

Error Output

5/9/21, 10:02 AM [yarn.console.log.expectation] 🚨: expectFunctionToThrowAnError
{
    SomeError(message: "expectedError"): The operation couldn’t be completed. (Yarn.Yarn.SomeError error 1.)
}
关于
33.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号