How to stub a class method in OCMock?

前端 未结 5 1848
谎友^
谎友^ 2020-12-29 03:04

I often find in my iPhone Objective-C unit tests that I want stub out a class method, e.g. NSUrlConnection\'s +sendSynchronousRequest:returningResponse:error: method.

<
5条回答
  •  -上瘾入骨i
    2020-12-29 03:40

    Link to the blogpost in the question and RefuX gist inspired me to come up with block enabled implementation of their ideas: https://gist.github.com/1038034

提交回复
热议问题