Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ruby1.9 is NOT the entire world! (need raise instead of throw)

  • Loading branch information...
commit e6e2a0752ada47f1303fdcec4c8c676042756e0c 1 parent 54ff24d
@wishdev wishdev authored
Showing with 5 additions and 1 deletion.
  1. +1 −1  lib/http_parser.rb
  2. +4 −0 spec/parser_spec.rb
View
2  lib/http_parser.rb
@@ -10,7 +10,7 @@ class << self
def default_header_value_type=(val)
if (val != :mixed && val != :strings && val != :arrays)
- throw(ArgumentError, "Invalid header value type")
+ raise ArgumentError, "Invalid header value type"
end
@default_header_value_type = val
end
View
4 spec/parser_spec.rb
@@ -54,6 +54,10 @@
proc{ @parser.header_value_type = 'bob' }.should raise_error(ArgumentError)
end
+ it "should throw an Argument Error if default header value type is invalid" do
+ proc{ HTTP::Parser.default_header_value_type = 'bob' }.should raise_error(ArgumentError)
+ end
+
it "should implement basic api" do
@parser <<
"GET /test?ok=1 HTTP/1.1\r\n" +
Please sign in to comment.
Something went wrong with that request. Please try again.