File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -102,11 +102,7 @@ def status(status = nil)
102
102
fail ArgumentError , "Status code :#{ status } is invalid."
103
103
end
104
104
when Fixnum
105
- if Rack ::Utils ::HTTP_STATUS_CODES . keys . include? ( status )
106
- @status = status
107
- else
108
- fail ArgumentError , "Status code #{ status } is invalid."
109
- end
105
+ @status = status
110
106
when nil
111
107
return @status if @status
112
108
case request . request_method . to_s . upcase
Original file line number Diff line number Diff line change @@ -118,9 +118,8 @@ def initialize
118
118
. to raise_error ( ArgumentError , 'Status code :foo_bar is invalid.' )
119
119
end
120
120
121
- it 'raises error if unknow status code is passed' do
122
- expect { subject . status 210 }
123
- . to raise_error ( ArgumentError , 'Status code 210 is invalid.' )
121
+ it 'accepts unknown Fixnum status codes' do
122
+ expect { subject . status 210 } . to_not raise_error
124
123
end
125
124
126
125
it 'raises error if status is not a fixnum or symbol' do
You can’t perform that action at this time.
0 commit comments