Skip to content

Commit

Permalink
Range tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Nov 12, 2011
1 parent f36abf5 commit e067641
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/fixtures/nums
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1 @@
123456789
16 changes: 16 additions & 0 deletions test/static.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -105,6 +105,22 @@ describe('connect.static()', function(){
}) })
}) })


describe('Range', function(){
it('should support byte ranges', function(done){
app.request()
.get('/nums')
.set('Range', 'bytes=0-4')
.expect('12345', done);
})

it('should respond with 206 "Partial Content"', function(done){
app.request()
.get('/nums')
.set('Range', 'bytes=0-4')
.expect(206, done);
})
})

// TODO: node bug // TODO: node bug
// describe('on ENAMETOOLONG', function(){ // describe('on ENAMETOOLONG', function(){
// it('should next()', function(done){ // it('should next()', function(done){
Expand Down

0 comments on commit e067641

Please sign in to comment.