https://github.com/honghaoz/chouti
ChouTi is a repository of Swift packages that provides frameworks, utilities and extensions to enhance development on iOS and macOS.
https://github.com/honghaoz/chouti
ios macos swift
Last synced: 2 months ago
JSON representation
ChouTi is a repository of Swift packages that provides frameworks, utilities and extensions to enhance development on iOS and macOS.
- Host: GitHub
- URL: https://github.com/honghaoz/chouti
- Owner: honghaoz
- License: mit
- Created: 2023-12-10T07:38:03.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-23T04:57:10.000Z (about 2 years ago)
- Last Synced: 2024-05-23T05:00:29.187Z (about 2 years ago)
- Topics: ios, macos, swift
- Language: Swift
- Homepage:
- Size: 143 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ChouTi
[](https://github.com/honghaoz/ChouTi/actions/workflows/build.yml?query=branch%3Amaster)


**ChouTi** is a repository of Swift packages that provides frameworks, utilities and extensions to enhance development on Apple platforms.
## Installation
### Swift Package Manager
Add the following to your `Package.swift` file:
```swift
dependencies: [
// add the package to your package dependencies
.package(url: "https://github.com/honghaoz/ChouTi", from: "0.0.10"),
],
targets: [
// add products to your target dependencies
.target(
name: "MyTarget",
dependencies: [
.product(name: "ChouTi", package: "ChouTi"),
]
),
.testTarget(
name: "MyTargetTests",
dependencies: [
.product(name: "ChouTiTest", package: "ChouTi"),
]
),
]
```
## Packages
### ChouTi
[](https://codecov.io/github/honghaoz/ChouTi/tree/master/packages%2FChouTi%2FSources?flags%5B0%5D=ChouTi&displayType=list)
[**ChouTi**](packages/ChouTi) is a Swift framework that provides common utilities and extensions to enhance development on Apple platforms.
```swift
import ChouTi
...
```
### ChouTiTest
[](https://codecov.io/github/honghaoz/ChouTi/tree/master/packages%2FChouTiTest%2FSources?flags%5B0%5D=ChouTiTest&displayType=list)
[**ChouTiTest**](packages/ChouTiTest) is a Swift testing framework for writing tests with simple, expressive syntax.
```swift
import ChouTiTest
class SomeTests: XCTestCase {
func testExample() throws {
// boolean
expect(expression).to(beTrue())
expect(expression) == true
expect(expression).to(beFalse())
expect(expression) == false
expect(expression).toNot(beTrue())
expect(expression) != true
// collection
expect(expression).to(beEmpty())
expect(expression).toNot(beEmpty())
// equal
expect(expression).to(beEqual(to: 2))
expect(expression) == 2
expect(expression).toNot(beEqual(to: 2))
expect(expression) != 2
expect(expression).to(beApproximatelyEqual(to: 2, within: 1e-6))
expect(expression).toNot(beApproximatelyEqual(to: 2, within: 1e-6))
// identical
expect(expression).to(beIdentical(to: object))
expect(expression) === object
// nil
expect(expression).to(beNil())
expect(expression) == nil
expect(expression).toNot(beNil())
expect(expression) != nil
// unwrap
try expect(unwrap(expression)) == expectedValue
// error
expect(try expression()).to(throwError(SomeError.error))
expect(try expression()).toNot(throwError(SomeError.error))
// error type
expect(try expression()).to(throwErrorOfType(SomeError.self))
expect(try expression()).toNot(throwErrorOfType(SomeError.self))
// any error
expect(try expression()).to(throwAnError())
expect(try expression()).toNot(throwAnError())
// eventually
expect(expression).toEventually(beTrue())
expect(expression).toEventually(beEmpty())
expect(expression).toEventually(beEqual(to: 2))
expect(expression).toEventually(beIdentical(to: object))
expect(expression).toEventually(beNil())
expect(try expression()).toEventually(throwError(SomeError.error))
expect(try expression()).toEventually(throwErrorOfType(SomeError.self))
expect(try expression()).toEventually(throwAnError())
expect(expression).toEventuallyNot(beTrue())
expect(expression).toEventuallyNot(beEmpty())
expect(expression).toEventuallyNot(beEqual(to: 2))
expect(expression).toEventuallyNot(beIdentical(to: object))
expect(expression).toEventuallyNot(beNil())
expect(try expression()).toEventuallyNot(throwError(SomeError.error))
expect(try expression()).toEventuallyNot(throwErrorOfType(SomeError.self))
expect(try expression()).toEventuallyNot(throwAnError())
}
}
```
## License
ChouTi is available under the MIT license. See the [LICENSE](https://github.com/honghaoz/ChouTi/blob/master/LICENSE) file for more info.