diff --git a/Tests/TestInit/FixtureInit.swift b/Tests/TestInit/FixtureInit.swift index aca4a2be..55ffa213 100644 --- a/Tests/TestInit/FixtureInit.swift +++ b/Tests/TestInit/FixtureInit.swift @@ -354,3 +354,21 @@ class MyProtocolMock: MyProtocol { } } """ + +@Fixture enum initWithDictionaryThatHasFunction { + /// @mockable + protocol Tester { + var testDictionary: [String: () -> String] { get } + } + + @Fixture enum expected { + class TesterMock: Tester { + init() { } + init(testDictionary: [String: () -> String] = [String: () -> String]()) { + self.testDictionary = testDictionary + } + + var testDictionary: [String: () -> String] = [String: () -> String]() + } + } +} diff --git a/Tests/TestInit/InitTests.swift b/Tests/TestInit/InitTests.swift index 2a8da0b0..9306e08c 100644 --- a/Tests/TestInit/InitTests.swift +++ b/Tests/TestInit/InitTests.swift @@ -55,4 +55,11 @@ class InitTests: MockoloTestCase { dstContent: typedThrowableInitMock ) } + + func testInitWithDictionaryThatHasFunction() { + verify( + srcContent: initWithDictionaryThatHasFunction._source, + dstContent: initWithDictionaryThatHasFunction.expected._source + ) + } }