uber / mockolo

Efficient Mock Generator for Swift
Apache License 2.0
804 stars 85 forks source link

Support `actor` object conforming to `Actor` protocol #222

Open treastrain opened 1 year ago

treastrain commented 1 year ago

Issue

Part of #216 (https://github.com/uber/mockolo/issues/216#issuecomment-1454179318 's "2.")

Description

Add feature generating mocks for that protocol that conform to the Actor automatically become actor.

For details: https://github.com/uber/mockolo/issues/216#issuecomment-1454179318

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

uhooi commented 1 year ago

@treastrain The test is failing in Xcode 12. Since Swift Concurrency (async/await, Actor etc) is available from Xcode 13, please skip the test in Xcode 12.

Test Suite 'MockActorTests' started at 2023-03-10 13:00:08.892
Test Case '-[MockoloTests.MockActorTests testActorProtocol]' started.
/Users/runner/work/mockolo/mockolo/Tests/MockoloTestCase.swift:154: error: -[MockoloTests.MockActorTests testActorProtocol] : XCTAssertTrue failed
Test Case '-[MockoloTests.MockActorTests testActorProtocol]' failed (1.854 seconds).
Test Suite 'MockActorTests' failed at 2023-03-10 13:00:10.746.
     Executed 1 test, with 1 failure (0 unexpected) in 1.854 (1.854) seconds

ref: https://github.com/uber/mockolo/actions/runs/4376819642/jobs/7676406579#step:5:251