aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/range/count_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/range/count_spec.rb')
-rw-r--r--spec/ruby/core/range/count_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/ruby/core/range/count_spec.rb b/spec/ruby/core/range/count_spec.rb
new file mode 100644
index 0000000000..f6f60fa054
--- /dev/null
+++ b/spec/ruby/core/range/count_spec.rb
@@ -0,0 +1,14 @@
+require_relative '../../spec_helper'
+
+describe "Range#count" do
+ ruby_version_is "2.7" do
+ it "returns Infinity for beginless ranges without arguments or blocks" do
+ inf = Float::INFINITY
+ eval("('a'...)").count.should == inf
+ eval("(7..)").count.should == inf
+ eval("(...'a')").count.should == inf
+ eval("(...nil)").count.should == inf
+ eval("(..10.0)").count.should == inf
+ end
+ end
+end