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

Version Path
malagant-soap4r-1.5.8.20141127181857 test/soap/test_nestedexception.rb
rtiss_soap4r-1.6.1 test/soap/test_nestedexception.rb
rtiss_soap4r-1.6.0 test/soap/test_nestedexception.rb
eSpace_soap4r-1.5.8 test/soap/test_nestedexception.rb
soap4r-ruby19-1.5.9 test/soap/test_nestedexception.rb
tomdz-soap4r-1.5.8.20120202093209 test/soap/test_nestedexception.rb
soap5r-2.0.3 test/soap/test_nestedexception.rb
soap5r-2.0.2 test/soap/test_nestedexception.rb
soap5r-2.0.1 test/soap/test_nestedexception.rb
soap5r-2.0.0 test/soap/test_nestedexception.rb
soap5r-2.0.0.20120130130121 test/soap/test_nestedexception.rb
soap4r-sgonyea-1.5.9 test/soap/test_nestedexception.rb
sunteya-soap4r-1.5.8.0 test/soap/test_nestedexception.rb
tomdz-soap4r-1.5.8.20111103171510 test/soap/test_nestedexception.rb
rubyjedi-soap4r-1.5.8.20100619003610 test/soap/test_nestedexception.rb