test cleanup, replace `define_method` and `remove_method` with stubs.

This replaces manual definition and removal of a method with `stubs` from `mocha`.