Sha256: 7b8e6a6d50d65e9d9d540814f4dd5c4732fe37b4b0d2f7f41a651af2d05001b5

Contents?: true

Size: 1.48 KB

Versions: 24

Compression:

Stored size: 1.48 KB

Contents

require File.dirname(__FILE__) + "/../../../test_helper"

unit_tests do
  test "make_exception_marshallable wraps exception in a mashallable exception" do
    error = Test::Unit::Error.new "test_name", Exception.new("message")
    error.make_exception_marshallable

    assert_kind_of DeepTest::MarshallableExceptionWrapper, error.exception
  end

  test "calling make_exception_marshallable twice only wraps exception once" do
    error = Test::Unit::Error.new "test_name", Exception.new("message")
    error.make_exception_marshallable
    error.make_exception_marshallable

    assert_kind_of DeepTest::MarshallableExceptionWrapper, error.exception
  end

  test "error is accessible as normal when it has not been made marshallable" do
    error = Test::Unit::Error.new "test_name", e = Exception.new("message")
    assert_equal e, error.exception
  end

  test "resolve_marshallable_exception restores the original exception" do
    error = Test::Unit::Error.new "test_name", Exception.new("message")
    error.make_exception_marshallable
    error.resolve_marshallable_exception

    assert_kind_of Exception, error.exception
    assert_equal   'message', error.exception.message
  end

  test "resolve_marshallable_exception does not fail when exception has not been made marshallable" do
    error = Test::Unit::Error.new "test_name", Exception.new("message")
    error.resolve_marshallable_exception

    assert_kind_of Exception, error.exception
    assert_equal   'message', error.exception.message
  end
end

Version data entries

24 entries across 24 versions & 4 rubygems

Version Path
jason-o-matic-deep_test-1.2.2.1 test/deep_test/test/extensions/error_test.rb
jason-o-matic-deep_test-1.2.2.10 test/deep_test/test/extensions/error_test.rb
jason-o-matic-deep_test-1.2.2.11 test/deep_test/test/extensions/error_test.rb
jason-o-matic-deep_test-1.2.2.12 test/deep_test/test/extensions/error_test.rb
jason-o-matic-deep_test-1.2.2.13 test/deep_test/test/extensions/error_test.rb
jason-o-matic-deep_test-1.2.2.14 test/deep_test/test/extensions/error_test.rb
jason-o-matic-deep_test-1.2.2.2 test/deep_test/test/extensions/error_test.rb
jason-o-matic-deep_test-1.2.2.3 test/deep_test/test/extensions/error_test.rb
jason-o-matic-deep_test-1.2.2.4 test/deep_test/test/extensions/error_test.rb
jason-o-matic-deep_test-1.2.2.5 test/deep_test/test/extensions/error_test.rb
jason-o-matic-deep_test-1.2.2.6 test/deep_test/test/extensions/error_test.rb
jason-o-matic-deep_test-1.2.2.7 test/deep_test/test/extensions/error_test.rb
jason-o-matic-deep_test-1.2.2.8 test/deep_test/test/extensions/error_test.rb
jason-o-matic-deep_test-1.2.2.9 test/deep_test/test/extensions/error_test.rb
jperkins-deep_test-1.2.2 test/deep_test/test/extensions/error_test.rb
jason-o-matic-deep_test-1.2.2.15 test/deep_test/test/extensions/error_test.rb
jstorimer-deep-test-1.4.0 test/deep_test/test/extensions/error_test.rb
jstorimer-deep-test-1.3.0 test/deep_test/test/extensions/error_test.rb
jstorimer-deep-test-1.2.0 test/deep_test/test/extensions/error_test.rb
jstorimer-deep-test-1.1.0 test/deep_test/test/extensions/error_test.rb