]> git.openstreetmap.org Git - rails.git/blobdiff - vendor/gems/rspec-1.1.2/lib/spec/expectations/errors.rb
added RSpec and RSpec on Rails
[rails.git] / vendor / gems / rspec-1.1.2 / lib / spec / expectations / errors.rb
diff --git a/vendor/gems/rspec-1.1.2/lib/spec/expectations/errors.rb b/vendor/gems/rspec-1.1.2/lib/spec/expectations/errors.rb
new file mode 100644 (file)
index 0000000..1fabd10
--- /dev/null
@@ -0,0 +1,12 @@
+module Spec
+  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
+    end
+  end
+end