almodovar 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/vendor/resourceful-0.5.3-patched/MIT-LICENSE +21 -0
- data/vendor/resourceful-0.5.3-patched/Manifest +29 -0
- data/vendor/resourceful-0.5.3-patched/README.markdown +84 -0
- data/vendor/resourceful-0.5.3-patched/Rakefile +71 -0
- data/vendor/resourceful-0.5.3-patched/lib/resourceful.rb +18 -0
- data/vendor/resourceful-0.5.3-patched/lib/resourceful/authentication_manager.rb +108 -0
- data/vendor/resourceful-0.5.3-patched/lib/resourceful/cache_manager.rb +240 -0
- data/vendor/resourceful-0.5.3-patched/lib/resourceful/exceptions.rb +34 -0
- data/vendor/resourceful-0.5.3-patched/lib/resourceful/header.rb +126 -0
- data/vendor/resourceful-0.5.3-patched/lib/resourceful/http_accessor.rb +98 -0
- data/vendor/resourceful-0.5.3-patched/lib/resourceful/memcache_cache_manager.rb +75 -0
- data/vendor/resourceful-0.5.3-patched/lib/resourceful/net_http_adapter.rb +70 -0
- data/vendor/resourceful-0.5.3-patched/lib/resourceful/options_interpreter.rb +78 -0
- data/vendor/resourceful-0.5.3-patched/lib/resourceful/request.rb +230 -0
- data/vendor/resourceful-0.5.3-patched/lib/resourceful/resource.rb +163 -0
- data/vendor/resourceful-0.5.3-patched/lib/resourceful/response.rb +221 -0
- data/vendor/resourceful-0.5.3-patched/lib/resourceful/stubbed_resource_proxy.rb +47 -0
- data/vendor/resourceful-0.5.3-patched/lib/resourceful/util.rb +6 -0
- data/vendor/resourceful-0.5.3-patched/resourceful.gemspec +48 -0
- data/vendor/resourceful-0.5.3-patched/spec/acceptance/authorization_spec.rb +16 -0
- data/vendor/resourceful-0.5.3-patched/spec/acceptance/caching_spec.rb +192 -0
- data/vendor/resourceful-0.5.3-patched/spec/acceptance/header_spec.rb +24 -0
- data/vendor/resourceful-0.5.3-patched/spec/acceptance/redirecting_spec.rb +12 -0
- data/vendor/resourceful-0.5.3-patched/spec/acceptance/resource_spec.rb +84 -0
- data/vendor/resourceful-0.5.3-patched/spec/acceptance_shared_specs.rb +44 -0
- data/vendor/resourceful-0.5.3-patched/spec/old_acceptance_specs.rb +378 -0
- data/vendor/resourceful-0.5.3-patched/spec/simple_sinatra_server.rb +74 -0
- data/vendor/resourceful-0.5.3-patched/spec/simple_sinatra_server_spec.rb +98 -0
- data/vendor/resourceful-0.5.3-patched/spec/spec.opts +3 -0
- data/vendor/resourceful-0.5.3-patched/spec/spec_helper.rb +28 -0
- metadata +32 -2
@@ -0,0 +1,98 @@
|
|
1
|
+
|
2
|
+
require 'rubygems'
|
3
|
+
require 'sinatra'
|
4
|
+
require 'sinatra/test/rspec'
|
5
|
+
|
6
|
+
require File.dirname(__FILE__) + '/spec_helper'
|
7
|
+
|
8
|
+
describe "GET /" do
|
9
|
+
it 'should render "Hello, world!"' do
|
10
|
+
get '/'
|
11
|
+
@response.should be_ok
|
12
|
+
@response.body.should == "Hello, world!"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
describe "POST /" do
|
17
|
+
it 'should be 201 with no body' do
|
18
|
+
post '/'
|
19
|
+
@response.should be_ok
|
20
|
+
@response.body.should == ""
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'should return the request body as the response body' do
|
24
|
+
body = "Some text"
|
25
|
+
post '/', body
|
26
|
+
@response.should be_ok
|
27
|
+
@response.body.should == body
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe "PUT /" do
|
32
|
+
it 'should be 200 with no body' do
|
33
|
+
put '/'
|
34
|
+
@response.should be_ok
|
35
|
+
@response.body.should == ""
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'should return the request body as the response body' do
|
39
|
+
body = "Some text"
|
40
|
+
put '/', body
|
41
|
+
@response.should be_ok
|
42
|
+
@response.body.should == body
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
describe "DELETE /" do
|
47
|
+
it 'should render "Deleted"' do
|
48
|
+
delete '/'
|
49
|
+
@response.should be_ok
|
50
|
+
@response.body.should == "Deleted"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
describe "/method" do
|
55
|
+
it 'should respond with the method used to make the request' do
|
56
|
+
%w[get post put delete].each do |verb|
|
57
|
+
send verb, '/method'
|
58
|
+
@response.body.should == verb.upcase
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
describe "/code/nnn" do
|
64
|
+
it 'should respond with the code provided in the url' do
|
65
|
+
# Just try a handful
|
66
|
+
[200, 201, 301, 302, 304, 403, 404, 500].each do |code|
|
67
|
+
get "/code/#{code}"
|
68
|
+
@response.status.should == code
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
describe "/header" do
|
74
|
+
it 'should set response headers from the query string' do
|
75
|
+
get "/header", "X-Foo" => "Bar"
|
76
|
+
@response['X-Foo'].should == "Bar"
|
77
|
+
end
|
78
|
+
|
79
|
+
it 'should dump the request headers into the body as yaml' do
|
80
|
+
get '/header', {}, "X-Foo" => "Bar"
|
81
|
+
body = YAML.load(@response.body)
|
82
|
+
body['X-Foo'].should == "Bar"
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
describe "/cache" do
|
87
|
+
it 'should be normal 200 if the modified query param and the ims header dont match' do
|
88
|
+
now = Time.now
|
89
|
+
get '/cached', {"modified" => now.httpdate}, {"HTTP_IF_MODIFIED_SINCE" => (now - 3600).httpdate}
|
90
|
+
@response.should be_ok
|
91
|
+
end
|
92
|
+
|
93
|
+
it 'should be 304 if the modified query param and the ims header are the same' do
|
94
|
+
now = Time.now
|
95
|
+
get '/cached', {"modified" => now.httpdate}, {"HTTP_IF_MODIFIED_SINCE" => now.httpdate}
|
96
|
+
@response.status.should == 304
|
97
|
+
end
|
98
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'spec'
|
3
|
+
|
4
|
+
$LOAD_PATH << File.join(File.dirname(__FILE__), "..", "lib")
|
5
|
+
require 'resourceful'
|
6
|
+
|
7
|
+
$LOAD_PATH << File.dirname(__FILE__) # ./spec
|
8
|
+
|
9
|
+
# Spawn the server in another process
|
10
|
+
|
11
|
+
@server = Thread.new do
|
12
|
+
|
13
|
+
require 'simple_sinatra_server'
|
14
|
+
Sinatra::Default.set(
|
15
|
+
:run => true,
|
16
|
+
:logging => false
|
17
|
+
)
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
# Kill the server process when rspec finishes
|
22
|
+
at_exit { @server.exit }
|
23
|
+
|
24
|
+
|
25
|
+
# Give the app a change to initialize
|
26
|
+
$stderr.puts "Waiting for thin to initialize..."
|
27
|
+
sleep 0.2
|
28
|
+
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 2
|
9
|
+
version: 0.1.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- BeBanjo S.L.
|
@@ -76,6 +76,36 @@ extensions: []
|
|
76
76
|
extra_rdoc_files:
|
77
77
|
- README.rdoc
|
78
78
|
files:
|
79
|
+
- vendor/resourceful-0.5.3-patched/lib/resourceful/authentication_manager.rb
|
80
|
+
- vendor/resourceful-0.5.3-patched/lib/resourceful/cache_manager.rb
|
81
|
+
- vendor/resourceful-0.5.3-patched/lib/resourceful/exceptions.rb
|
82
|
+
- vendor/resourceful-0.5.3-patched/lib/resourceful/header.rb
|
83
|
+
- vendor/resourceful-0.5.3-patched/lib/resourceful/http_accessor.rb
|
84
|
+
- vendor/resourceful-0.5.3-patched/lib/resourceful/memcache_cache_manager.rb
|
85
|
+
- vendor/resourceful-0.5.3-patched/lib/resourceful/net_http_adapter.rb
|
86
|
+
- vendor/resourceful-0.5.3-patched/lib/resourceful/options_interpreter.rb
|
87
|
+
- vendor/resourceful-0.5.3-patched/lib/resourceful/request.rb
|
88
|
+
- vendor/resourceful-0.5.3-patched/lib/resourceful/resource.rb
|
89
|
+
- vendor/resourceful-0.5.3-patched/lib/resourceful/response.rb
|
90
|
+
- vendor/resourceful-0.5.3-patched/lib/resourceful/stubbed_resource_proxy.rb
|
91
|
+
- vendor/resourceful-0.5.3-patched/lib/resourceful/util.rb
|
92
|
+
- vendor/resourceful-0.5.3-patched/lib/resourceful.rb
|
93
|
+
- vendor/resourceful-0.5.3-patched/Manifest
|
94
|
+
- vendor/resourceful-0.5.3-patched/MIT-LICENSE
|
95
|
+
- vendor/resourceful-0.5.3-patched/Rakefile
|
96
|
+
- vendor/resourceful-0.5.3-patched/README.markdown
|
97
|
+
- vendor/resourceful-0.5.3-patched/resourceful.gemspec
|
98
|
+
- vendor/resourceful-0.5.3-patched/spec/acceptance/authorization_spec.rb
|
99
|
+
- vendor/resourceful-0.5.3-patched/spec/acceptance/caching_spec.rb
|
100
|
+
- vendor/resourceful-0.5.3-patched/spec/acceptance/header_spec.rb
|
101
|
+
- vendor/resourceful-0.5.3-patched/spec/acceptance/redirecting_spec.rb
|
102
|
+
- vendor/resourceful-0.5.3-patched/spec/acceptance/resource_spec.rb
|
103
|
+
- vendor/resourceful-0.5.3-patched/spec/acceptance_shared_specs.rb
|
104
|
+
- vendor/resourceful-0.5.3-patched/spec/old_acceptance_specs.rb
|
105
|
+
- vendor/resourceful-0.5.3-patched/spec/simple_sinatra_server.rb
|
106
|
+
- vendor/resourceful-0.5.3-patched/spec/simple_sinatra_server_spec.rb
|
107
|
+
- vendor/resourceful-0.5.3-patched/spec/spec.opts
|
108
|
+
- vendor/resourceful-0.5.3-patched/spec/spec_helper.rb
|
79
109
|
- lib/almodovar.rb
|
80
110
|
- README.rdoc
|
81
111
|
has_rdoc: true
|