diff options
-rw-r--r-- | lib/rack/lint.rb | 4 | ||||
-rw-r--r-- | test/spec_rack_lint.rb | 12 |
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/rack/lint.rb b/lib/rack/lint.rb index 7bc433b8..79bd9c02 100644 --- a/lib/rack/lint.rb +++ b/lib/rack/lint.rb @@ -215,6 +215,10 @@ module Rack @input = input end + def size + @input.size + end + ## * +gets+ must be called without arguments and return a string, ## or +nil+ on EOF. def gets(*args) diff --git a/test/spec_rack_lint.rb b/test/spec_rack_lint.rb index dbb6687e..3d8c2edb 100644 --- a/test/spec_rack_lint.rb +++ b/test/spec_rack_lint.rb @@ -299,5 +299,17 @@ context "Rack::Lint" do }.should.raise(Rack::Lint::LintError). message.should.match(/close must not be called/) end +end +context "Rack::Lint::InputWrapper" do + specify "delegates :size to underlying IO object" do + class IOMock + def size + 101 + end + end + + wrapper = Rack::Lint::InputWrapper.new(IOMock.new) + wrapper.size.should == 101 + end end |