get rid of deprecation warning.

@penguincoder - I've been seeing this warning in our tests, and I just want to clean it up. My only question is the context of "self" in the class_eval. Will that work here?
Merge pull request #1 from taelor/patch-1

get rid of deprecation warning.