From: Dave Thomas Date: 2000-10-10T01:06:34+09:00 Subject: [ruby-talk:5338] Re: string streams in Ruby? Hugh Sasse Staff Elec Eng writes: > Is there any way, without going through "modifying the internals", > to convert Strings to look like files? This would allow me to do > things like > > input = < example input for my class > More of the same > other stuff > ..etc > END > > while input_as_file.gets > ... > end > > within my unit tests, which would keep all the input with the > tests. Depending on your circumstances, you could change your code to read the file using #each, which works for both strings and files. input_as_file.each do |line| ... end Regards Dave