rack-alive 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/rack/alive.rb +2 -2
- data/lib/rack/alive/version.rb +1 -1
- data/spec/rack-alive_spec.rb +5 -5
- metadata +4 -4
data/lib/rack/alive.rb
CHANGED
@@ -19,9 +19,9 @@ module Rack
|
|
19
19
|
|
20
20
|
def alive_response(sucess)
|
21
21
|
if sucess
|
22
|
-
[200, {'Content-Type' => 'text/plain'}, "true"]
|
22
|
+
[200, {'Content-Type' => 'text/plain'}, ["true"]]
|
23
23
|
else
|
24
|
-
[500, {'Content-Type' => 'text/plain'}, "false"]
|
24
|
+
[500, {'Content-Type' => 'text/plain'}, ["false"]]
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
data/lib/rack/alive/version.rb
CHANGED
data/spec/rack-alive_spec.rb
CHANGED
@@ -15,7 +15,7 @@ describe Rack::Alive do
|
|
15
15
|
|
16
16
|
describe "Middleware" do
|
17
17
|
before do
|
18
|
-
@app = lambda { |env| [200, {'Content-Type' => 'text/plain'}, ""] }
|
18
|
+
@app = lambda { |env| [200, {'Content-Type' => 'text/plain'}, [""]] }
|
19
19
|
end
|
20
20
|
|
21
21
|
describe "Minimal setup: No custom conditions" do
|
@@ -23,7 +23,7 @@ describe Rack::Alive do
|
|
23
23
|
request = Rack::MockRequest.env_for("/alive?")
|
24
24
|
response = Rack::Alive.new(@app).call(request)
|
25
25
|
status(response).must_equal 200
|
26
|
-
body(response).must_equal "true"
|
26
|
+
body(response).must_equal ["true"]
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -34,7 +34,7 @@ describe Rack::Alive do
|
|
34
34
|
false
|
35
35
|
}).call(request)
|
36
36
|
status(response).must_equal 500
|
37
|
-
body(response).must_equal "false"
|
37
|
+
body(response).must_equal ["false"]
|
38
38
|
end
|
39
39
|
|
40
40
|
it 'should not be alive if block conditions raise error' do
|
@@ -43,7 +43,7 @@ describe Rack::Alive do
|
|
43
43
|
raise "SHIT - WHERE ARE ALL THE HORSES???!!! *drama-queen scream*"
|
44
44
|
}).call(request)
|
45
45
|
status(response).must_equal 500
|
46
|
-
body(response).must_equal "false"
|
46
|
+
body(response).must_equal ["false"]
|
47
47
|
end
|
48
48
|
|
49
49
|
it 'should be alive if block conditions are true' do
|
@@ -52,7 +52,7 @@ describe Rack::Alive do
|
|
52
52
|
true
|
53
53
|
}).call(request)
|
54
54
|
status(response).must_equal 200
|
55
|
-
body(response).must_equal "true"
|
55
|
+
body(response).must_equal ["true"]
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rack-alive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Merchii
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2011-09-
|
14
|
+
date: 2011-09-29 00:00:00 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rack
|
@@ -138,7 +138,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
138
138
|
requirements:
|
139
139
|
- - ">="
|
140
140
|
- !ruby/object:Gem::Version
|
141
|
-
hash:
|
141
|
+
hash: 888209916753596045
|
142
142
|
segments:
|
143
143
|
- 0
|
144
144
|
version: "0"
|
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
147
|
requirements:
|
148
148
|
- - ">="
|
149
149
|
- !ruby/object:Gem::Version
|
150
|
-
hash:
|
150
|
+
hash: 888209916753596045
|
151
151
|
segments:
|
152
152
|
- 0
|
153
153
|
version: "0"
|