Skip to content

Releases: seanhenry/SwiftMockGeneratorForXcode

v1-beta.28

06 Jul 14:16
Compare
Choose a tag to compare

Important

Any versions previous to v1-beta.28 will expire on 10th Sept 2022. Installing this version will fix this issue.

Changes

  • Resigns with new Developer ID to extend signing expiry date.
  • Makes universal build for both x86_64 and arm64 architectures.
  • Minimum OS version is now 11.0 (Big Sur)

Big Sur Support

30 Oct 20:22
Compare
Choose a tag to compare
Big Sur Support Pre-release
Pre-release
  • #43 Rebuilds in Xcode 12.1 to support the new security features in Big Sur.

Thanks to @MattAydin and @dannypier for pointing this out and helping me find a fix 👍

  • #41 Fixes typo in error message

Thanks to @rolandkakonyi for fixing this 👍

Command line support

13 Apr 18:03
Compare
Choose a tag to compare
Command line support Pre-release
Pre-release
  • Now bundled with a command line tool to generate mocks from Terminal.
  • The app and Xcode extension are now fully sandboxed.
  • The project dependencies are now compiled and included so it can be built be anyone.
  • Improves formatting of the generated code.

Using the command line tool

For convenience, create a symbolic link to the CLI.

$ ln -s "/Applications/Swift Mock Generator for Xcode.app/Contents/MacOS/genmock" /usr/local/bin/genmock

Use $ genmock --help for a list of options.

See how this project generates its mocks here.

Sandboxing

This extension is fully sandboxed which means you need to give permission to read your project files before using it.

Give permission when automatically detecting the project path

  • Open the companion app.
  • Press "Give permission to read directory".
  • Select the directory and press "Grant permission".
  • In Xcode, generate your test double.

Give permission when manually choosing the project path

  • Open the companion app.
  • Press the select directory button.
  • Select the directory and press "Open".
  • In Xcode, generate your test double.

Please note if using manual project paths before v0.25 you will have to select your project path again.

Fixes automation issue

05 Nov 14:44
Compare
Choose a tag to compare
Pre-release
v1-beta.24

Merge sk-fix into master

Catalina and Xcode 11 support

21 Oct 22:27
Compare
Choose a tag to compare
Pre-release
  • Built for Catalina and Mojave only.
  • Performance fixes for resolving mocked types.

Please see the latest release for a build.

Improved Xcode 11 support

01 Oct 21:16
Compare
Choose a tag to compare
Pre-release

Please see the latest release.

Xcode 11

15 Sep 16:05
Compare
Choose a tag to compare
Xcode 11 Pre-release
Pre-release

Please see the latest release.

Parses `open` keyword

26 Jun 16:45
Compare
Choose a tag to compare
Parses `open` keyword Pre-release
Pre-release
  • Parses the open keyword when used as an identifier.

Subscripts

31 Mar 18:23
Compare
Choose a tag to compare
Subscripts Pre-release
Pre-release
  • Supports most subscript features *
  • Adds fixes for Swift 5
  • The app bundle is now notarized by Apple

* Missing subscript features include closure arguments and generic parameters.

Breaking Changes

  • Dummies now generate a fatalError() if a default value cannot be found for the return type.
  • Swift 5 no longer allows for IUOs in arrays ([Int!]). They are now generated as optionals ([Int?]).

Example:

protocol P {
  var property: Int! { set get }
}

Swift 4

...
var invokedProperty: Int?
var invokedPropertyList = [Int!]()
...

Swift 5

...
var invokedProperty: Int?
var invokedPropertyList = [Int?]()
...

Partial spies

26 Oct 08:19
Compare
Choose a tag to compare
Partial spies Pre-release
Pre-release
  • Adds more logging around SourceKit errors
  • Adds a new test double - "partial spy"

What is a partial spy?

Partial spies are spies which can also forward calls to the original implementation.

E.g.

class MyClass {
  func myMethod() {
    print("original implementation")
  }
}

class MyClassPartialSpy: MyClass {
... // generated partial spy
}

let mySpy = MyClassPartialSpy()

mySpy.myMethod() // does not print "original implementation"

mySpy.forwardToOriginalMyMethod = true

mySpy.myMethod() // prints "original implementation"