1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2021-01-28 17:08:57 +01:00
parent 1b377b32c8
commit 2e32b919b4
35 changed files with 832 additions and 10 deletions

View file

@ -29,4 +29,13 @@ describe "Integer#digits" do
it "raises Math::DomainError when calling digits on a negative number" do
-> { -12345.digits(7) }.should raise_error(Math::DomainError)
end
it "returns integer values > 9 when base is above 10" do
1234.digits(16).should == [2, 13, 4]
end
it "can be used with base > 37" do
1234.digits(100).should == [34, 12]
980099.digits(100).should == [99, 0, 98]
end
end