I can use the following code to test that cruiser has been called twice. But how to test that the parameter of first call is 7, and the param of second call is 8?
id cruiser = [Cruiser cruiser];
[[cruiser should] receive:@selector(energyLevelInWrapCore:) withCount:2];
[cruiser energyLevelInWarpCore:7];
[cruiser energyLevelInWarpCore:8];
And is it possible to get the parameter after the method is called? Like the following code.
id cruiser = [Cruiser cruiser];
[cruiser stub:@selector(energyLevelInWarpCore:)];
[cruiser energyLevelInWarpCore:7];
[cruiser energyLevelInWarpCore:8];
[[[[[cruiser stub] calles][1] arguments][0] should] equal:theValue(8)]; // This doesn't work