cuba 3.0.0.rc3 → 3.0.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/cuba.gemspec +1 -1
  2. data/lib/cuba.rb +1 -1
  3. data/test/redirect.rb +21 -0
  4. metadata +9 -8
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cuba"
3
- s.version = "3.0.0.rc3"
3
+ s.version = "3.0.0.rc4"
4
4
  s.summary = "Microframework for web applications."
5
5
  s.description = "Cuba is a microframework for web applications."
6
6
  s.authors = ["Michel Martens"]
@@ -33,7 +33,7 @@ class Cuba
33
33
  end
34
34
 
35
35
  def redirect(path, status = 302)
36
- @headers = { "Location" => path }
36
+ @headers["Location"] = path
37
37
  @status = status
38
38
  end
39
39
 
@@ -0,0 +1,21 @@
1
+ require File.expand_path("helper", File.dirname(__FILE__))
2
+
3
+ test "redirect" do
4
+ Cuba.define do
5
+ on "hello" do
6
+ res.write "hello, world"
7
+ end
8
+
9
+ on "" do
10
+ res.redirect "/hello"
11
+ end
12
+ end
13
+
14
+ env = { "SCRIPT_NAME" => "/", "PATH_INFO" => "/" }
15
+
16
+ status, headers, body = Cuba.call(env)
17
+
18
+ assert_equal status, 302
19
+ assert_equal headers, {"Content-Type"=>"text/html", "Location"=>"/hello"}
20
+ assert_response body, []
21
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cuba
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.rc3
4
+ version: 3.0.0.rc4
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-02 00:00:00.000000000 Z
12
+ date: 2012-03-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
16
- requirement: &2151932460 !ruby/object:Gem::Requirement
16
+ requirement: &2151932520 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2151932460
24
+ version_requirements: *2151932520
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: cutest
27
- requirement: &2151931380 !ruby/object:Gem::Requirement
27
+ requirement: &2151931480 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2151931380
35
+ version_requirements: *2151931480
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: capybara
38
- requirement: &2151929200 !ruby/object:Gem::Requirement
38
+ requirement: &2151929660 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2151929200
46
+ version_requirements: *2151929660
47
47
  description: Cuba is a microframework for web applications.
48
48
  email:
49
49
  - michel@soveran.com
@@ -75,6 +75,7 @@ files:
75
75
  - test/path.rb
76
76
  - test/plugin.rb
77
77
  - test/redefinition.rb
78
+ - test/redirect.rb
78
79
  - test/render.rb
79
80
  - test/root.rb
80
81
  - test/run.rb