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 2020-06-27 15:51:37 +02:00
parent 64d8c0815e
commit b3fa158d1c
35 changed files with 652 additions and 56 deletions

View file

@ -190,6 +190,22 @@ describe "C-API Array function" do
end
end
describe "rb_ary_sort" do
it "returns a new sorted array" do
a = [2, 1, 3]
@s.rb_ary_sort(a).should == [1, 2, 3]
a.should == [2, 1, 3]
end
end
describe "rb_ary_sort_bang" do
it "sorts the given array" do
a = [2, 1, 3]
@s.rb_ary_sort_bang(a).should == [1, 2, 3]
a.should == [1, 2, 3]
end
end
describe "rb_ary_store" do
it "overwrites the element at the given position" do
a = [1, 2, 3]