diff options
author | Benoit Daloze <[email protected]> | 2020-06-27 15:51:37 +0200 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2020-06-27 15:51:37 +0200 |
commit | b3fa158d1c4d8e03b8dc04f1e4f9940a8a4ef44c (patch) | |
tree | fa8a62d6192c24a21e70aa02589507adfe4e4e6a /spec/ruby/optional/capi/array_spec.rb | |
parent | 64d8c0815e6ab042e8a67a670bda9f34404fa662 (diff) |
Update to ruby/spec@b6b7752
Diffstat (limited to 'spec/ruby/optional/capi/array_spec.rb')
-rw-r--r-- | spec/ruby/optional/capi/array_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/ruby/optional/capi/array_spec.rb b/spec/ruby/optional/capi/array_spec.rb index 1a26c6c585..8d003fb2b1 100644 --- a/spec/ruby/optional/capi/array_spec.rb +++ b/spec/ruby/optional/capi/array_spec.rb @@ -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] |