Explicitly handle the exception for failed loading.

The exception handler was only catching RuntimeError, which probably
should not be caught by the harness (so a test fails), when it should
have been catching LoadError exceptions (module not present to test).

Signed-off-by: Konstantin Haase <konstantin.mailinglists@googlemail.com>
This commit is contained in:
elij 2011-01-25 00:27:15 -08:00 committed by Konstantin Haase
parent 4dee18bf86
commit e16bc71590
14 changed files with 35 additions and 14 deletions

View File

@ -83,6 +83,6 @@ class CoffeeTest < Test::Unit::TestCase
end
end
rescue
rescue LoadError
warn "#{$!.to_s}: skipping coffee tests"
end

View File

@ -1,4 +1,6 @@
require File.dirname(__FILE__) + '/helper'
begin
require 'erubis'
class ERubisTest < Test::Unit::TestCase
@ -80,3 +82,7 @@ class ERubisTest < Test::Unit::TestCase
assert_equal '<outer><inner>hi</inner></outer>', body
end
end
rescue LoadError
warn "#{$!.to_s}: skipping erubis tests"
end

View File

@ -95,6 +95,7 @@ class HAMLTest < Test::Unit::TestCase
assert_equal "bar\n", body
end
end
rescue
rescue LoadError
warn "#{$!.to_s}: skipping haml tests"
end

View File

@ -1,4 +1,6 @@
require File.dirname(__FILE__) + '/helper'
begin
require 'less'
class LessTest < Test::Unit::TestCase
@ -59,3 +61,7 @@ class LessTest < Test::Unit::TestCase
assert_raise(Errno::ENOENT) { get('/') }
end
end
rescue LoadError
warn "#{$!.to_s}: skipping less tests"
end

View File

@ -53,6 +53,7 @@ class LiquidTest < Test::Unit::TestCase
assert_equal 'foo', body
end
end
rescue
rescue LoadError
warn "#{$!.to_s}: skipping liquid tests"
end

View File

@ -74,6 +74,7 @@ class MarkabyTest < Test::Unit::TestCase
assert_equal 'foo', body
end
end
rescue
rescue LoadError
warn "#{$!.to_s}: skipping markaby tests"
end

View File

@ -1,7 +1,7 @@
require File.dirname(__FILE__) + '/helper'
begin
fail "rdiscount not available" if defined? JRuby
fail LoadError, "rdiscount not available" if defined? JRuby
require 'rdiscount'
class MarkdownTest < Test::Unit::TestCase
@ -30,6 +30,7 @@ class MarkdownTest < Test::Unit::TestCase
assert_raise(Errno::ENOENT) { get('/') }
end
end
rescue
rescue LoadError
warn "#{$!.to_s}: skipping markdown tests"
end

View File

@ -64,6 +64,7 @@ class NokogiriTest < Test::Unit::TestCase
assert_raise(Errno::ENOENT) { get('/') }
end
end
rescue
rescue LoadError
warn "#{$!.to_s}: skipping nokogiri tests"
end

View File

@ -1,7 +1,7 @@
require File.dirname(__FILE__) + '/helper'
begin
fail 'Radius broken on 1.9.' if RUBY_VERSION >= '1.9.1'
fail LoadError, 'Radius broken on 1.9.' if RUBY_VERSION >= '1.9.1'
require 'radius'
class RadiusTest < Test::Unit::TestCase
@ -54,6 +54,7 @@ class RadiusTest < Test::Unit::TestCase
assert_equal 'foo', body
end
end
rescue
rescue LoadError
warn "#{$!.to_s}: skipping radius tests"
end

View File

@ -29,6 +29,7 @@ class RdocTest < Test::Unit::TestCase
assert_raise(Errno::ENOENT) { get('/') }
end
end
rescue
rescue LoadError
warn "#{$!.to_s}: skipping rdoc tests"
end

View File

@ -110,6 +110,6 @@ class SassTest < Test::Unit::TestCase
end
end
rescue
rescue LoadError
warn "#{$!.to_s}: skipping sass tests"
end

View File

@ -83,6 +83,6 @@ class ScssTest < Test::Unit::TestCase
end
end
rescue
rescue LoadError
warn "#{$!.to_s}: skipping scss tests"
end

View File

@ -92,6 +92,7 @@ class SlimTest < Test::Unit::TestCase
assert_equal "<!DOCTYPE html><h1 class=\"header\">Hello World</h1>", body
end
end
rescue
rescue LoadError
warn "#{$!.to_s}: skipping slim tests"
end

View File

@ -29,6 +29,7 @@ class TextileTest < Test::Unit::TestCase
assert_raise(Errno::ENOENT) { get('/') }
end
end
rescue
rescue LoadError
warn "#{$!.to_s}: skipping textile tests"
end