Skip to content

Releases: seanhenry/SwiftMockGeneratorForXcode

v1-beta.28

Choose a tag to compare

@seanhenry seanhenry released this 06 Jul 14:16

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

Big Sur Support Pre-release
Pre-release

Choose a tag to compare

@seanhenry seanhenry released this 30 Oct 20:22
  • #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

Command line support Pre-release
Pre-release

Choose a tag to compare

@seanhenry seanhenry released this 13 Apr 18:03
  • 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

Pre-release

Choose a tag to compare

@seanhenry seanhenry released this 05 Nov 14:44
v1-beta.24

Merge sk-fix into master

Catalina and Xcode 11 support

Pre-release

Choose a tag to compare

@seanhenry seanhenry released this 21 Oct 22:27
  • Built for Catalina and Mojave only.
  • Performance fixes for resolving mocked types.

Please see the latest release for a build.

Improved Xcode 11 support

Pre-release

Choose a tag to compare

@seanhenry seanhenry released this 01 Oct 21:16

Please see the latest release.

Xcode 11

Xcode 11 Pre-release
Pre-release

Choose a tag to compare

@seanhenry seanhenry released this 15 Sep 16:05

Please see the latest release.

Parses `open` keyword

Parses `open` keyword Pre-release
Pre-release

Choose a tag to compare

@seanhenry seanhenry released this 26 Jun 16:45
  • Parses the open keyword when used as an identifier.

Subscripts

Subscripts Pre-release
Pre-release

Choose a tag to compare

@seanhenry seanhenry released this 31 Mar 18:23
  • 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

Partial spies Pre-release
Pre-release

Choose a tag to compare

@seanhenry seanhenry released this 26 Oct 08:19
  • 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"