Fix tests failing with newer rspec

This PR makes tests run with newer RSpec (2.12 at least). There are still some deprecation warnings, but everything should keep working on older RSpec.