Skip to content

Instantly share code, notes, and snippets.

@iain
Created July 25, 2010 14:47
Show Gist options
  • Save iain/489606 to your computer and use it in GitHub Desktop.
Save iain/489606 to your computer and use it in GitHub Desktop.
module RSpec
module Expectations
# If Test::Unit is loaed, we'll use its error as baseclass, so that Test::Unit
# will report unmet RSpec expectations as failures rather than errors.
superclass = ['Test::Unit::AssertionFailedError', '::StandardError'].map do |c|
eval(c) rescue nil
end.compact.first
class ExpectationNotMetError < superclass
def spec_failure?
true
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment