Sha256: 1721a1926af7b7ffa094870253e7ceec82c4fa20308c3554c54f04389dcd43f9
Contents?: true
Size: 864 Bytes
Versions: 27
Compression:
Stored size: 864 Bytes
Contents
require 'test/unit' require 'nodejs' class TestNodejsError < Test::Unit::TestCase def test_should_preserve_stack raise ArgumentError.new('oops') rescue => ex backtrace_line = " from nodejs/test_error.rb:#{__LINE__ - 2}" wrapped_ex = ex.exception %(context - #{ex.message}) assert(`wrapped_ex.stack`.include?(backtrace_line)) end def test_should_set_stack raise ArgumentError.new('oops') rescue => ex backtrace_line = " from nodejs/test_error.rb:#{__LINE__ - 2}" wrapped_ex = ex.exception %(context - #{ex.message}) wrapped_ex.set_backtrace ex.backtrace assert(`wrapped_ex.stack`.include?(backtrace_line)) end def test_should_get_stack raise ArgumentError.new('oops') rescue => ex backtrace_line = " from nodejs/test_error.rb:#{__LINE__ - 2}" assert(`ex.stack`.include?(backtrace_line)) end end
Version data entries
27 entries across 27 versions & 1 rubygems