Kernel#enum_for and Enumerator.new implementations (with specs)