making the test 1.8.7 compatible

Using respond_to? instead if object.methods.