Skip to content

Commit

Permalink
Adjust code for Swift 6
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsaidi committed Oct 4, 2024
1 parent 11f5512 commit a1096bb
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 77 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
<p align="center">
<img src ="Resources/Logo_GitHub.png" alt="MockingKit Logo" title="MockingKit" />
<img src ="Resources/Logo_Rounded.png" alt="MockingKit Logo" title="MockingKit" />
</p>

<p align="center">
<img src="https://img.shields.io/github/v/release/danielsaidi/MockingKit?color=%2300550&sort=semver" alt="Version" />
<img src="https://img.shields.io/badge/Swift-5.9-orange.svg" alt="Swift 5.9" />
<img src="https://img.shields.io/badge/Swift-6.0-orange.svg" alt="Swift 6.0" />
<img src="https://img.shields.io/github/license/danielsaidi/MockingKit" alt="MIT License" />
<a href="https://twitter.com/danielsaidi"><img src="https://img.shields.io/twitter/url?label=Twitter&style=social&url=https%3A%2F%2Ftwitter.com%2Fdanielsaidi" alt="Twitter: @danielsaidi" title="Twitter: @danielsaidi" /></a>
<a href="https://mastodon.social/@danielsaidi"><img src="https://img.shields.io/mastodon/follow/000253346?label=mastodon&style=social" alt="Mastodon: @[email protected]" title="Mastodon: @[email protected]" /></a>
</p>



## About MockingKit

MockingKit is a Swift SDK that lets you easily mock protocols and classes in `Swift`.
MockingKit is a Swift SDK that lets you easily mock protocols and classes.

MockingKit lets you create mocks of any protocol or class, after which you can `call` functions, `register` dynamic function results, automatically `record` method invocations, and `inspect` all recorded calls.

Expand Down Expand Up @@ -81,19 +80,19 @@ calls[0].result // => "gnirts"
mock.hasCalled(\.doStuffRef) // => true
```

For more information, please see the [getting started guide][Getting-Started].
See the online [getting started guide][Getting-Started] for more information.



## Documentation

The [online documentation][Documentation] has more information, articles, code examples, etc.
The online [documentation][Documentation] has more information, articles, code examples, etc.



## Demo Application

The demo app lets you explore the library. To try it out, just open and run the `Demo` project.
The `Demo` folder has an app that lets you explore the library and see how mocks behave.



Expand Down
Binary file added Resources/Logo_Rounded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion Sources/MockingKit/MockingKit.docc/MockingKit.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,4 @@ ApiKit is available under the MIT license.

- ``MockNotificationCenter``
- ``MockPasteboard``
- ``MockTextDocumentProxy``
- ``MockUserDefaults``
4 changes: 2 additions & 2 deletions Sources/MockingKit/Mocks/MockNotificationCenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import Foundation

/// This class can be used to mock `NotificationCenter`.
open class MockNotificationCenter: NotificationCenter, Mockable {
open class MockNotificationCenter: NotificationCenter, Mockable, @unchecked Sendable {

public lazy var addObserverForNameRef = MockReference(mockAddObserverForName)
public lazy var addObserverWithSelectorRef = MockReference(mockAddObserverWithSelector)
public lazy var postNotificationRef = MockReference(mockPostNotification)
Expand Down
2 changes: 1 addition & 1 deletion Sources/MockingKit/Mocks/MockPasteboard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import UIKit
///
/// This mock only mocks `setData(_:forPasteboardType:)` for
/// now, but you can subclass it and mock more functionality.
open class MockPasteboard: UIPasteboard, Mockable {
open class MockPasteboard: UIPasteboard, Mockable, @unchecked Sendable {

public lazy var setDataRef = MockReference(setData)

Expand Down
66 changes: 0 additions & 66 deletions Sources/MockingKit/Mocks/MockTextDocumentProxy.swift

This file was deleted.

0 comments on commit a1096bb

Please sign in to comment.