I'm trying to read a file into a string. For instance, I tried reading this file:

```
123456  
23456  
3456  
456  
56  
6

```

I tried: 

```
contents = File.open("test.txt", "rb").read  
print contents

```

---

```
IO.foreach('test.txt') do |line|  
  print line  
end

```

---

```
File.open('test.txt', 'r').each_line do |line|
  print line
end     

```

but I seem to get a single line that will overwrite it's contents with each new line. I get `666666`.