Add tests for InstanceMethod classes

I don’t remember why we introduced this feature without tests, but here they are at last :smile: