Skip to content

Optional properties have a force-unwrapped stub #48

Description

@mattgapadmi

Given a protocol with an optional property like:

protocol MyProtocol {
  var myProperty: String? { get }
}

The following non-optional stubbed value is generated:

    var invokedMyPropertyGetter = false
    var invokedMyPropertyGetterCount = 0
    var stubbedMyProperty: String!

    var myProperty: String? {
        invokedMyPropertyGetter = true
        invokedMyPropertyGetterCount += 1
        return stubbedMyProperty
    }

Would it be possible for optional properties to have optional stubbed values?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions