Skip to content

Commit

Permalink
A test that demonstrates a bug in read_from
Browse files Browse the repository at this point in the history
  • Loading branch information
loganb committed Feb 13, 2012
1 parent 6fb2bb7 commit 055bef9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions spec/buffer_spec.rb
Expand Up @@ -153,6 +153,23 @@
wp.close
@buffer.read_from(rp).should == nil
end

it "Maintains proper buffer size" do
#TODO use more methods

#Testing of normal append
str = "clarp of the flarn"
@buffer.append(str)
s = @buffer.size
s.should == str.length

#Testing of read_from
(rp, wp) = File.pipe
wp.write(str)
wp.close
@buffer.read_from(rp)
@buffer.size.should == 2*str.length
end

#######
private
Expand Down

0 comments on commit 055bef9

Please sign in to comment.