tjarratt / fake4swift

A small CLI for generating Swift test doubles
MIT License
24 stars 3 forks source link

Capture local and global labels for methods #18

Closed tjarratt closed 7 years ago

tjarratt commented 7 years ago

When a protocol has a method whose argument labels differ between the caller and the callee, we need to capture both of these and include both in the generated code (otherwise the protocol adherence will fail).

Given this protocol

protocol DoesStuffWithLabels {
  func loadCurrentUserInfo(completionBlock completion: SomeBlockType)
}

We generate this incorrect code

class FakeDoesStuffWithLabels {
// snip
  func loadCurrentUserInfo(completion: SomeBlockType) {
  // omitted for brevity
  }
//snip
}
tjarratt commented 7 years ago

Fixed by 2771050.

brew update && brew upgrade fake4swift if you want to see this behavior locally.