Skip to content

Commit 1d6bd76

Browse files
committed
Add spec for ranges as object literals.
1 parent 95a4e6f commit 1d6bd76

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

spec/ruby/language/range_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
(1...10).should == Range.new(1, 10, true)
1111
end
1212

13+
it "creates a simple range as an object literal" do
14+
ary = []
15+
2.times do
16+
ary.push(1..3)
17+
end
18+
ary[0].object_id.should == ary[1].object_id
19+
end
20+
1321
it "creates endless ranges" do
1422
(1..).should == Range.new(1, nil)
1523
(1...).should == Range.new(1, nil, true)

0 commit comments

Comments
 (0)