0
0
Fork 0

Add default value for the body

This commit is contained in:
Stormwind 2012-11-18 16:09:41 +01:00
parent 3c3850a02b
commit 3ff56d815a
2 changed files with 8 additions and 1 deletions

View File

@ -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]

View File

@ -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