require_relative './test_helper' class TestArray < Minitest::Test def setup @array = [1, 2] end def test_to_construct assert_instance_of Construct, @array.to_construct assert_equal 1, @array.to_construct.car assert_equal 2, @array.to_construct.cdr.car assert_equal :nil, @array.to_construct.cdr.cdr # requires implementation of == for Construct # assert_equal Construct.new(1, Construct.new(2, :nil)), @array.to_construct end end