diff options
-rw-r--r-- | lib/zero/response.rb | 3 | ||||
-rw-r--r-- | spec/unit/response/response_spec.rb | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/zero/response.rb b/lib/zero/response.rb index 2966fa2..0981261 100644 --- a/lib/zero/response.rb +++ b/lib/zero/response.rb @@ -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] diff --git a/spec/unit/response/response_spec.rb b/spec/unit/response/response_spec.rb index 0f47680..bced8c1 100644 --- a/spec/unit/response/response_spec.rb +++ b/spec/unit/response/response_spec.rb @@ -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 |