aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStormwind <stormwind@stormwinds-page.de>2012-11-18 16:38:38 +0100
committerStormwind <stormwind@stormwinds-page.de>2012-11-18 16:38:38 +0100
commit2e073a07fac3978b28ef348c4c73d17ca68d0722 (patch)
tree12a951ad24fbc5c403860b40beaebbe6c183370e
parente6e3b0bd2721f288a9795533f975e8995222396c (diff)
Restructure response specs
Also no change in behaviour
-rw-r--r--spec/unit/response/response_spec.rb67
1 files changed, 35 insertions, 32 deletions
diff --git a/spec/unit/response/response_spec.rb b/spec/unit/response/response_spec.rb
index bced8c1..c314567 100644
--- a/spec/unit/response/response_spec.rb
+++ b/spec/unit/response/response_spec.rb
@@ -1,44 +1,47 @@
require 'spec_helper'
-describe Zero::Response, '#finish' do
+describe Zero::Response do
subject { Zero::Response.new() }
-
- it "returns an array within status header and body" do
- subject.status = 200
- subject.header = {}
- subject.body = []
-
- value = subject.to_a
-
- value.should be_an_instance_of(Array)
- value[0].should eq(200) # Status code
- value[1].should eq({}) # Headers
- value[2].should eq([]) # Body
- end
-end
-describe Zero::Response, '#status' do
- it "must return the status always as an integer" do
- subject.status = "foobar"
- subject.status.should eq(0)
+ describe '#finish' do
+ it "returns an array within status header and body" do
+ subject.status = 200
+ subject.header = {}
+ subject.body = []
+
+ value = subject.to_a
- subject.status = 240.5
- subject.status.should eq(240)
+ value.should be_an_instance_of(Array)
+ value[0].should eq(200) # Status code
+ value[1].should eq({}) # Headers
+ value[2].should eq([]) # Body
+ end
end
- it "must return 200, if no status code was set" do
- subject.status.should eq(200)
+ describe '#status' do
+ it "must return the status always as an integer" do
+ subject.status = "foobar"
+ subject.status.should eq(0)
+
+ subject.status = 240.5
+ subject.status.should eq(240)
+ end
+
+ it "must return 200, if no status code was set" do
+ subject.status.should eq(200)
+ end
end
-end
-describe Zero::Response, '#header' do
- it "must return an empty hash, if no header was set" do
- subject.header.should eq({})
+ describe '#header' do
+ it "must return an empty hash, if no header was set" do
+ subject.header.should eq({})
+ end
end
-end
-describe Zero::Response, '#body' do
- it "must return an empty array, if no body was set" do
- subject.body.should eq([])
+ describe '#body' do
+ it "must return an empty array, if no body was set" do
+ subject.body.should eq([])
+ end
end
-end
+
+end \ No newline at end of file