rocketio 0.0.0.pre.alpha → 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +5 -2
- data/LICENSE.txt +22 -0
- data/README.md +5 -22
- data/Rakefile +1 -7
- data/lib/rocketio.rb +3 -131
- data/lib/rocketio/version.rb +2 -2
- data/rocketio.gemspec +17 -21
- metadata +11 -146
- data/.travis.yml +0 -3
- data/bin/console +0 -14
- data/bin/setup +0 -7
- data/lib/rocketio/application.rb +0 -31
- data/lib/rocketio/controller.rb +0 -288
- data/lib/rocketio/controller/authentication.rb +0 -141
- data/lib/rocketio/controller/authorization.rb +0 -53
- data/lib/rocketio/controller/cookies.rb +0 -59
- data/lib/rocketio/controller/error_handlers.rb +0 -89
- data/lib/rocketio/controller/filters.rb +0 -119
- data/lib/rocketio/controller/flash.rb +0 -21
- data/lib/rocketio/controller/helpers.rb +0 -438
- data/lib/rocketio/controller/middleware.rb +0 -32
- data/lib/rocketio/controller/render.rb +0 -148
- data/lib/rocketio/controller/render/engine.rb +0 -76
- data/lib/rocketio/controller/render/layout.rb +0 -27
- data/lib/rocketio/controller/render/layouts.rb +0 -85
- data/lib/rocketio/controller/render/templates.rb +0 -83
- data/lib/rocketio/controller/request.rb +0 -115
- data/lib/rocketio/controller/response.rb +0 -84
- data/lib/rocketio/controller/sessions.rb +0 -64
- data/lib/rocketio/controller/token_auth.rb +0 -118
- data/lib/rocketio/controller/websocket.rb +0 -21
- data/lib/rocketio/error_templates/404.html +0 -3
- data/lib/rocketio/error_templates/409.html +0 -7
- data/lib/rocketio/error_templates/500.html +0 -3
- data/lib/rocketio/error_templates/501.html +0 -6
- data/lib/rocketio/error_templates/layout.html +0 -1
- data/lib/rocketio/exceptions.rb +0 -4
- data/lib/rocketio/router.rb +0 -65
- data/lib/rocketio/util.rb +0 -122
- data/test/aliases_test.rb +0 -54
- data/test/authentication_test.rb +0 -307
- data/test/authorization_test.rb +0 -91
- data/test/cache_control_test.rb +0 -268
- data/test/content_type_test.rb +0 -124
- data/test/cookies_test.rb +0 -49
- data/test/error_handlers_test.rb +0 -125
- data/test/etag_test.rb +0 -445
- data/test/filters_test.rb +0 -177
- data/test/halt_test.rb +0 -73
- data/test/helpers_test.rb +0 -171
- data/test/middleware_test.rb +0 -57
- data/test/redirect_test.rb +0 -135
- data/test/render/engine_test.rb +0 -71
- data/test/render/get.erb +0 -1
- data/test/render/items.erb +0 -1
- data/test/render/layout.erb +0 -1
- data/test/render/layout_test.rb +0 -104
- data/test/render/layouts/master.erb +0 -1
- data/test/render/layouts_test.rb +0 -145
- data/test/render/master.erb +0 -1
- data/test/render/post.erb +0 -1
- data/test/render/put.erb +0 -1
- data/test/render/render_test.rb +0 -101
- data/test/render/setup.rb +0 -14
- data/test/render/templates/a/get.erb +0 -1
- data/test/render/templates/master.erb +0 -1
- data/test/render/templates_test.rb +0 -146
- data/test/request_test.rb +0 -105
- data/test/response_test.rb +0 -119
- data/test/routes_test.rb +0 -70
- data/test/sendfile_test.rb +0 -209
- data/test/sessions_test.rb +0 -176
- data/test/setup.rb +0 -59
data/test/setup.rb
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
ENV['RACK_ENV'] = 'testing'
|
2
|
-
require 'rack/radar'
|
3
|
-
$:.unshift(File.expand_path('../../lib', __FILE__))
|
4
|
-
require 'rocketio'
|
5
|
-
|
6
|
-
spec do
|
7
|
-
include Rack::Radar
|
8
|
-
|
9
|
-
def mock_app *controllers
|
10
|
-
RocketIO::Application.new(controllers)
|
11
|
-
end
|
12
|
-
|
13
|
-
def mock_controller path = :/, superclass = nil, &block
|
14
|
-
path, superclass = :/, path if path.is_a?(Class)
|
15
|
-
controller = Class.new(superclass || RocketIO::Controller)
|
16
|
-
controller.map(path)
|
17
|
-
controller.class_exec(&block) if block
|
18
|
-
controller
|
19
|
-
end
|
20
|
-
|
21
|
-
assert :ok, :is_ok do |response|
|
22
|
-
response.status == 200
|
23
|
-
end
|
24
|
-
|
25
|
-
assert :ok_with_body, :is_ok_with_body do |response,body|
|
26
|
-
response.status == 200 && response.body == body
|
27
|
-
end
|
28
|
-
|
29
|
-
assert :is_unimplemented do |response|
|
30
|
-
response.status == 501
|
31
|
-
end
|
32
|
-
|
33
|
-
assert :is_unauthorized do |response|
|
34
|
-
response.status == 401
|
35
|
-
end
|
36
|
-
|
37
|
-
assert :is_authorized do |response|
|
38
|
-
response.status != 401
|
39
|
-
end
|
40
|
-
|
41
|
-
assert :is_not_modified do |response|
|
42
|
-
response.status == 304
|
43
|
-
response.body == ''
|
44
|
-
end
|
45
|
-
|
46
|
-
assert :is_precondition_failed do |response|
|
47
|
-
response.status == 412
|
48
|
-
response.body == ''
|
49
|
-
end
|
50
|
-
|
51
|
-
assert :is_errored do |response|
|
52
|
-
response.status == 500
|
53
|
-
end
|
54
|
-
|
55
|
-
assert :returned do |response, status, body|
|
56
|
-
response.status == status
|
57
|
-
response.body == body if body
|
58
|
-
end
|
59
|
-
end
|