Spies

When a double is instanced, Gut will record calls to methods that are defined in the script or scripts it inherits from. You can then make assertions to check if a method was called, not called, passed certain values, or how many times it was called.

You should read the page on doubling before using this, as there are some gotchas with doubling.

You can only spy on methods that have been included in the Double. Built-in functions (such as set_position) are not doubled by default, so you cannot spy on them unless you have set the Double Strategy.