mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@8d74d49
This commit is contained in:
parent
c940397116
commit
d80e44deec
157 changed files with 581 additions and 543 deletions
|
@ -67,12 +67,15 @@ describe "Integer#round" do
|
|||
25.round(-1, half: :up).should eql(30)
|
||||
25.round(-1, half: :down).should eql(20)
|
||||
25.round(-1, half: :even).should eql(20)
|
||||
25.round(-1, half: nil).should eql(30)
|
||||
35.round(-1, half: :up).should eql(40)
|
||||
35.round(-1, half: :down).should eql(30)
|
||||
35.round(-1, half: :even).should eql(40)
|
||||
35.round(-1, half: nil).should eql(40)
|
||||
(-25).round(-1, half: :up).should eql(-30)
|
||||
(-25).round(-1, half: :down).should eql(-20)
|
||||
(-25).round(-1, half: :even).should eql(-20)
|
||||
(-25).round(-1, half: nil).should eql(-30)
|
||||
end
|
||||
|
||||
ruby_version_is "2.4"..."2.5" do
|
||||
|
@ -90,4 +93,9 @@ describe "Integer#round" do
|
|||
35.round(1, half: :even).should eql(35)
|
||||
end
|
||||
end
|
||||
|
||||
it "raises ArgumentError for an unknown rounding mode" do
|
||||
lambda { 42.round(-1, half: :foo) }.should raise_error(ArgumentError, /invalid rounding mode: foo/)
|
||||
lambda { 42.round(1, half: :foo) }.should raise_error(ArgumentError, /invalid rounding mode: foo/)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue