Bacon_Rack 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/Bacon_Rack/module.rb +1 -1
- data/lib/Bacon_Rack/version.rb +1 -1
- data/spec/Bacon_Rack.rb +7 -8
- data/spec/lib/main.rb +11 -0
- metadata +2 -2
data/lib/Bacon_Rack/module.rb
CHANGED
data/lib/Bacon_Rack/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Bacon_Rack_Version = "0.2.
|
1
|
+
Bacon_Rack_Version = "0.2.1"
|
data/spec/Bacon_Rack.rb
CHANGED
@@ -28,14 +28,13 @@ describe ":redirects_to" do
|
|
28
28
|
}
|
29
29
|
end
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
}
|
31
|
+
it "ignores SERVER_NAME in location header" do
|
32
|
+
last_request.env['SERVER_NAME'] = "http://random.org/"
|
33
|
+
last_response.status = 301
|
34
|
+
last_response['Location'] = "http://random.org/new"
|
35
|
+
|
36
|
+
redirects_to '/new'
|
37
|
+
end
|
39
38
|
|
40
39
|
it "accepts both a status and path" do
|
41
40
|
last_response.status = 303
|
data/spec/lib/main.rb
CHANGED
@@ -26,6 +26,17 @@ require 'pry'
|
|
26
26
|
|
27
27
|
class Bacon::Context
|
28
28
|
|
29
|
+
def last_request
|
30
|
+
@o ||= begin
|
31
|
+
new_o = Object.new
|
32
|
+
def new_o.env
|
33
|
+
@h ||= Hash['SERVER_NAME'=>'http://www.example.org']
|
34
|
+
end
|
35
|
+
new_o
|
36
|
+
end
|
37
|
+
@o
|
38
|
+
end
|
39
|
+
|
29
40
|
def last_response
|
30
41
|
@fake_rack ||= Fake_Rack.new
|
31
42
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Bacon_Rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bacon
|