Skip to content

TestUp::Console#puts changes Ruby console output of Arrays #210

@MSP-Greg

Description

@MSP-Greg

The following code in main will change the console output of Arrays when loaded:

def puts(*args)
if args.empty?
write $/
else
for arg in args
line = arg.to_s
write(line)
if line.empty? || !line.end_with?($/)
write($/)
end
end
end
nil
end

Without it loaded, puts [1,2,3] shows the following in the console:

1
2
3

With it loaded, Array#to_s is used, so it outputs:

[1,2,3]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions