Skip to content

Commit d2c7dd7

Browse files
Lillian ZhangNicolas Laurent
authored andcommitted
Range#count spec fix: Range#count runs infinitely on endless ranges in 2.6
1 parent 0458acc commit d2c7dd7

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

spec/ruby/core/range/count_spec.rb

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
require_relative '../../spec_helper'
22

33
describe "Range#count" do
4-
ruby_version_is "2.6" do
5-
it "returns Infinity for endless ranges without arguments or blocks" do
6-
inf = Float::INFINITY
7-
eval("('a'...)").count.should == inf
8-
eval("(7..)").count.should == inf
9-
end
10-
end
11-
124
ruby_version_is "2.7" do
135
it "returns Infinity for beginless ranges without arguments or blocks" do
146
inf = Float::INFINITY
7+
eval("('a'...)").count.should == inf
8+
eval("(7..)").count.should == inf
159
eval("(...'a')").count.should == inf
1610
eval("(...nil)").count.should == inf
1711
eval("(..10.0)").count.should == inf

0 commit comments

Comments
 (0)