1
0
Fork 0
mirror of https://github.com/rubyjs/therubyrhino synced 2023-03-27 23:21:34 -04:00

fix error_spec under 9K

This commit is contained in:
kares 2015-04-29 11:50:01 +02:00
parent 01787dca77
commit e80a253a7a

View file

@ -81,7 +81,7 @@ describe Rhino::JSError do
# [ "at <eval>:1", "at org/mozilla/javascript/gen/<eval>:1" ] # [ "at <eval>:1", "at org/mozilla/javascript/gen/<eval>:1" ]
e.javascript_backtrace.should be_a Enumerable e.javascript_backtrace.should be_a Enumerable
e.javascript_backtrace.size.should >= 1 e.javascript_backtrace.size.should >= 1
e.javascript_backtrace[0].should == "at <eval>:1" e.javascript_backtrace[0].should =~ /at .*?<eval>:1/
e.javascript_backtrace(true).should be_a Enumerable e.javascript_backtrace(true).should be_a Enumerable
e.javascript_backtrace(true).size.should >= 1 e.javascript_backtrace(true).size.should >= 1
element = e.javascript_backtrace(true)[0] element = e.javascript_backtrace(true)[0]
@ -98,7 +98,7 @@ describe Rhino::JSError do
Rhino::Context.eval "function fortyTwo() { throw 42 }\n fortyTwo()" Rhino::Context.eval "function fortyTwo() { throw 42 }\n fortyTwo()"
rescue => e rescue => e
e.javascript_backtrace.size.should >= 2 e.javascript_backtrace.size.should >= 2
e.javascript_backtrace[0].should == "at <eval>:1 (fortyTwo)" e.javascript_backtrace[0].should =~ /at .*?<eval>:1 \(fortyTwo\)/
expect( e.javascript_backtrace.find { |trace| trace == "at <eval>:2" } ).to_not be nil expect( e.javascript_backtrace.find { |trace| trace == "at <eval>:2" } ).to_not be nil
else else
fail "expected to rescue" fail "expected to rescue"
@ -110,7 +110,7 @@ describe Rhino::JSError do
Rhino::Context.eval "throw 42" Rhino::Context.eval "throw 42"
rescue => e rescue => e
e.backtrace.should be_a Array e.backtrace.should be_a Array
e.backtrace[0].should == "at <eval>:1" e.backtrace[0].should =~ /at .*?<eval>:1/
e.backtrace[1].should_not be nil e.backtrace[1].should_not be nil
else else
fail "expected to rescue" fail "expected to rescue"