Sha256: 93a73492162fb57276b93c849f37b68ca4574215b2c184dd2e79293bd90bf647
Contents?: true
Size: 1.48 KB
Versions: 15
Compression:
Stored size: 1.48 KB
Contents
# encoding: ASCII-8BIT require 'helper' require 'soap/soap' module SOAP class TestNestedException < Test::Unit::TestCase class MyError < SOAP::Error; end def foo begin bar rescue raise MyError.new("foo", $!) end end def bar begin baz rescue raise MyError.new("bar", $!) end end def baz raise MyError.new("baz", $!) end def test_nestedexception begin foo rescue MyError => e trace = e.backtrace.find_all { |line| /test\/unit/ !~ line && /\d\z/ !~ line } trace = trace.map { |line| line.sub(/\A[^:]*/, '') } assert_equal(TOBE, trace) end end if (RUBY_VERSION.to_f >= 1.9) TOBE = [ ":16:in `rescue in foo'", ":13:in `foo'", ":34:in `test_nestedexception'", ":24:in `rescue in bar': bar (SOAP::TestNestedException::MyError) [NESTED]", ":21:in `bar'", ":14:in `foo'", ":34:in `test_nestedexception'", ":29:in `baz': baz (SOAP::TestNestedException::MyError) [NESTED]", ":22:in `bar'", ":14:in `foo'", ":34:in `test_nestedexception'" ] else TOBE = [ ":16:in `foo'", ":34:in `test_nestedexception'", ":24:in `bar': bar (SOAP::TestNestedException::MyError) [NESTED]", ":14:in `foo'", ":34:in `test_nestedexception'", ":29:in `baz': baz (SOAP::TestNestedException::MyError) [NESTED]", ":22:in `bar'", ":14:in `foo'", ":34:in `test_nestedexception'", ] end end end
Version data entries
15 entries across 15 versions & 9 rubygems