Sha256: dc954a0eb6de0c1c8e7324b1b733f25195ffc73de6d30d0ec831c26ef3316182
Contents?: true
Size: 484 Bytes
Versions: 70
Compression:
Stored size: 484 Bytes
Contents
describe "Numeric#upto [stop] when self and stop are Fixnums" do it "does not yield when stop is less than self" do result = [] 5.upto(4) { |x| result << x } result.should == [] end it "yields once when stop equals self" do result = [] 5.upto(5) { |x| result << x } result.should == [5] end it "yields while increasing self until it is less than stop" do result = [] 2.upto(5) { |x| result << x } result.should == [2, 3, 4, 5] end end
Version data entries
70 entries across 70 versions & 3 rubygems