Skip to content

Commit 2948aed

Browse files
committed
Add spec for aliasing $@
1 parent 83833fc commit 2948aed

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
require_relative '../../spec_helper'
22
require 'English'
33

4-
describe "alias keyword" do
5-
it "aliases $ERROR_INFO to $! in English and $ERROR_INFO still returns a backtrace" do
6-
(1 / 0 rescue $ERROR_INFO).should_not == nil
4+
describe "English" do
5+
it "aliases $! to $ERROR_INFO and $ERROR_INFO still returns an Exception with a backtrace" do
6+
exception = (1 / 0 rescue $ERROR_INFO)
7+
exception.should be_kind_of(Exception)
8+
exception.backtrace.should be_kind_of(Array)
9+
end
10+
11+
it "aliases $@ to $ERROR_POSITION and $ERROR_POSITION still returns a backtrace" do
12+
(1 / 0 rescue $ERROR_POSITION).should be_kind_of(Array)
713
end
814
end

0 commit comments

Comments
 (0)