diff options
| author | Paul Kmiec <[email protected]> | 2023-05-10 21:34:42 -0700 |
|---|---|---|
| committer | Paul Kmiec <[email protected]> | 2023-05-10 21:48:17 -0700 |
| commit | 0c64b01f6c4c92f27dab2d0019d7bd133308854b (patch) | |
| tree | a0f53a2242672ab5904a6a9e85dbceb0b43f67ac /test/util | |
| parent | 1d94514b6562131371130449eaccf711aa60dc95 (diff) | |
| download | caxlsx-0c64b01f6c4c92f27dab2d0019d7bd133308854b.tar.gz caxlsx-0c64b01f6c4c92f27dab2d0019d7bd133308854b.zip | |
Fix `SimpleTypedList#to_a` and `SimpleTypedList#to_ary` returning the internal list instance
The `to_a` and `to_ary` now work more like standard Array methods with `to_a` returning a
new array containing the elements of self and `to_ary` returning self.
Diffstat (limited to 'test/util')
| -rw-r--r-- | test/util/tc_simple_typed_list.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/util/tc_simple_typed_list.rb b/test/util/tc_simple_typed_list.rb index b62b5353..1a3d907b 100644 --- a/test/util/tc_simple_typed_list.rb +++ b/test/util/tc_simple_typed_list.rb @@ -82,7 +82,16 @@ class TestSimpleTypedList < Test::Unit::TestCase @list.push 1 @list.push 2 - assert_equal([1, 2], @list.to_ary) + assert_equal([1, 2], @list) + end + + def test_to_a + refute_equal(@list.object_id, @list.to_a.object_id) + assert_instance_of(Array, @list.to_a) + end + + def test_to_ary + assert_equal(@list.object_id, @list.to_ary.object_id) end def test_insert |
