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

Version Path
opal-0.5.5 spec/opal/core/numeric/downto_spec.rb
opal-0.5.4 spec/corelib/numeric/downto_spec.rb
opal-0.5.2 spec/corelib/numeric/downto_spec.rb
opal-0.5.0 spec/corelib/numeric/downto_spec.rb
opal-0.4.4 spec/rubyspec/core/numeric/downto_spec.rb
opal-0.4.3 spec/rubyspec/core/numeric/downto_spec.rb
opal-0.4.2 spec/rubyspec/core/numeric/downto_spec.rb
opal-0.4.1 spec/rubyspec/core/numeric/downto_spec.rb
opal-0.4.0 spec/rubyspec/core/numeric/downto_spec.rb
opal-0.3.44 spec/rubyspec/core/numeric/downto_spec.rb
opal-0.3.43 spec/rubyspec/core/numeric/downto_spec.rb
opal-0.3.42 spec/core/numeric/downto_spec.rb
opal-0.3.41 spec/core/numeric/downto_spec.rb
opal-0.3.40 spec/core/numeric/downto_spec.rb
opal-0.3.39 spec/core/numeric/downto_spec.rb
opal-0.3.38 spec/core/numeric/downto_spec.rb
opal-0.3.37 spec/core/numeric/downto_spec.rb
opal-0.3.36 spec/core/numeric/downto_spec.rb
opal-0.3.35 spec/core/numeric/downto_spec.rb
opal-0.3.34 spec/core/numeric/downto_spec.rb