Add default value for the body
This commit is contained in:
parent
3c3850a02b
commit
3ff56d815a
|
@ -12,6 +12,7 @@ module Zero
|
|||
def initialize
|
||||
@status = 200
|
||||
@header = {}
|
||||
@body = []
|
||||
end
|
||||
|
||||
# Sets the status.
|
||||
|
@ -27,7 +28,7 @@ module Zero
|
|||
# [status, header, body]
|
||||
# to be usable by any webserver
|
||||
#
|
||||
# @return Array
|
||||
# @return [Array]
|
||||
#
|
||||
def to_a()
|
||||
[@status, @header, @body]
|
||||
|
|
|
@ -36,3 +36,9 @@ describe Zero::Response, '#header' do
|
|||
subject.header.should eq({})
|
||||
end
|
||||
end
|
||||
|
||||
describe Zero::Response, '#body' do
|
||||
it "must return an empty array, if no body was set" do
|
||||
subject.body.should eq([])
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue