Sha256: ba8b09fc80fd94e61ace888c67c70d1d6462abcf334d1ce6118455a021c6b5c9
Contents?: true
Size: 893 Bytes
Versions: 6
Compression:
Stored size: 893 Bytes
Contents
# backtick_javascript: true 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
6 entries across 6 versions & 1 rubygems