Skip to content

Commit

Permalink
Fix spec failing cause of newer version of Ragel skiping some useless…
Browse files Browse the repository at this point in the history
… chars when parsing.

Make requiring mongrel in test optional but warn on error.
  • Loading branch information
macournoyer committed Dec 17, 2008
1 parent 0ab1062 commit d213b71
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions spec/request/parser_spec.rb
@@ -1,6 +1,11 @@
require File.dirname(__FILE__) + '/../spec_helper'

#require 'mongrel'
# Require mongrel so we can test that Thin parser don't clash w/ Mongrel parser.
begin
require 'mongrel'
rescue LoadError
warn "Install mongrel to test compatibility w/ it"
end

describe Request, 'parser' do
it 'should include basic headers' do
Expand Down Expand Up @@ -169,7 +174,7 @@
sorta_safe = %(GET #{path} HTTP/1.1\r\n\r\n)
nread = parser.execute(req, sorta_safe, 0)

sorta_safe.size.should == nread
sorta_safe.size.should == nread - 1 # Ragel 6 skips last linebreak
parser.should be_finished
parser.should_not be_error
end
Expand Down

0 comments on commit d213b71

Please sign in to comment.