summaryrefslogtreecommitdiff
path: root/spec/ruby/core/range/last_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/range/last_spec.rb')
-rw-r--r--spec/ruby/core/range/last_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/ruby/core/range/last_spec.rb b/spec/ruby/core/range/last_spec.rb
index d7ef776b42..6698686dd5 100644
--- a/spec/ruby/core/range/last_spec.rb
+++ b/spec/ruby/core/range/last_spec.rb
@@ -8,6 +8,12 @@ describe "Range#last" do
(1..5).last(3).should == [3, 4, 5]
end
+ ruby_bug '#18994', '2.7'...'3.2' do
+ it "returns the specified number if elements for single element inclusive range" do
+ (1..1).last(1).should == [1]
+ end
+ end
+
it "returns an empty array for an empty Range" do
(0...0).last(2).should == []
end