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