test/mapped_error_test.rb in sinatra-0.9.0.5 vs test/mapped_error_test.rb in sinatra-0.9.1
- old
+ new
@@ -1,11 +1,14 @@
require File.dirname(__FILE__) + '/helper'
-describe 'Exception Mappings' do
- class FooError < RuntimeError
- end
+class FooError < RuntimeError
+end
+class FooNotFound < Sinatra::NotFound
+end
+
+describe 'Exception Mappings' do
it 'invokes handlers registered with ::error when raised' do
mock_app {
set :raise_errors, false
error(FooError) { 'Foo!' }
get '/' do
@@ -76,12 +79,9 @@
raise Sinatra::NotFound
end
}
assert_nothing_raised { get '/' }
assert_equal 404, status
- end
-
- class FooNotFound < Sinatra::NotFound
end
it "cascades for subclasses of Sinatra::NotFound" do
mock_app {
set :raise_errors, true