mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@c3e6b90
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
819977e410
commit
0cb5fa5877
21 changed files with 329 additions and 461 deletions
|
@ -65,6 +65,10 @@ describe "Numeric#step" do
|
|||
describe "when no block is given" do
|
||||
describe "returned Enumerator" do
|
||||
describe "size" do
|
||||
it "should return infinity_value when limit is nil" do
|
||||
1.step(by: 42).size.should == infinity_value
|
||||
end
|
||||
|
||||
it "should return infinity_value when step is 0" do
|
||||
1.step(to: 5, by: 0).size.should == infinity_value
|
||||
end
|
||||
|
@ -73,13 +77,21 @@ describe "Numeric#step" do
|
|||
1.step(to: 2, by: 0.0).size.should == infinity_value
|
||||
end
|
||||
|
||||
it "should return infinity_value when the limit is Float::INFINITY" do
|
||||
it "should return infinity_value when ascending towards a limit of Float::INFINITY" do
|
||||
1.step(to: Float::INFINITY, by: 42).size.should == infinity_value
|
||||
end
|
||||
|
||||
it "should return infinity_value when decending towards a limit of -Float::INFINITY" do
|
||||
1.step(to: -Float::INFINITY, by: -42).size.should == infinity_value
|
||||
end
|
||||
|
||||
it "should return 1 when the both limit and step are Float::INFINITY" do
|
||||
1.step(to: Float::INFINITY, by: Float::INFINITY).size.should == 1
|
||||
end
|
||||
|
||||
it "should return 1 when the both limit and step are -Float::INFINITY" do
|
||||
1.step(to: -Float::INFINITY, by: -Float::INFINITY).size.should == 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue