Skip to content

Commit

Permalink
Add spec for aliasing $@
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Jan 28, 2020
1 parent e555cb2 commit f857322
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions library/English/alias_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
require_relative '../../spec_helper'
require 'English'

describe "alias keyword" do
it "aliases $ERROR_INFO to $! in English and $ERROR_INFO still returns a backtrace" do
(1 / 0 rescue $ERROR_INFO).should_not == nil
describe "English" do
it "aliases $! to $ERROR_INFO and $ERROR_INFO still returns an Exception with a backtrace" do
exception = (1 / 0 rescue $ERROR_INFO)
exception.should be_kind_of(Exception)
exception.backtrace.should be_kind_of(Array)
end

it "aliases $@ to $ERROR_POSITION and $ERROR_POSITION still returns a backtrace" do
(1 / 0 rescue $ERROR_POSITION).should be_kind_of(Array)
end
end

0 comments on commit f857322

Please sign in to comment.