0

How can I verify that my mock object created with OCMockito has received a method invocation with a primitive argument?

The method that I'm trying to test is setProgress:(float)progress

    CompositeProgressView* mockProgress = mock([CompositeProgressView class]);
    self.downloader.progressView = mockProgress;
//run a task that increments progress
...
//test
    [verify(mockProgress) setProgress:anything()]; //does not work
Community
  • 1
  • 1
Alex Stone
  • 46,408
  • 55
  • 231
  • 407
  • 1
    possible duplicate of [OCMockito anything() for primitive types](http://stackoverflow.com/questions/20562059/ocmockito-anything-for-primitive-types) – Eugen Martynov Jul 16 '14 at 08:04

1 Answers1

0
[[verify(mockProgress) withMatcher:anything()] setProgress:0];

A described in "How do you specify matchers for primitive arguments?" at https://github.com/jonreid/OCMockito.

Hope that helps!

Menno
  • 1,232
  • 12
  • 23