diff --git a/core/io/gets_spec.rb b/core/io/gets_spec.rb index 73d76b3ab..ca64bf860 100644 --- a/core/io/gets_spec.rb +++ b/core/io/gets_spec.rb @@ -24,6 +24,12 @@ end end + it "sets $_ to nil after the last line has been read" do + while @io.gets + end + $_.should be_nil + end + it "returns nil if called at the end of the stream" do IOSpecs.lines.length.times { @io.gets } @io.gets.should == nil