celluloid-http 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/celluloid-http/http.rb +1 -1
- data/lib/celluloid-http/request.rb +4 -3
- data/lib/celluloid-http/version.rb +1 -1
- data/test/unit/http_test.rb +1 -1
- metadata +1 -1
data/lib/celluloid-http/http.rb
CHANGED
@@ -8,6 +8,7 @@ class Celluloid::Http::Request
|
|
8
8
|
attr_accessor :method, :body
|
9
9
|
|
10
10
|
def_delegators :@uri, :scheme, :host, :path, :port, :query
|
11
|
+
def_delegators :@uri, :scheme=, :host=, :path=, :port=
|
11
12
|
|
12
13
|
def initialize(url, options = {})
|
13
14
|
@url = url
|
@@ -19,7 +20,7 @@ class Celluloid::Http::Request
|
|
19
20
|
end
|
20
21
|
|
21
22
|
def query_params
|
22
|
-
|
23
|
+
Rack::Utils.parse_nested_query @uri.query
|
23
24
|
end
|
24
25
|
|
25
26
|
def to_s
|
@@ -35,8 +36,8 @@ class Celluloid::Http::Request
|
|
35
36
|
end
|
36
37
|
|
37
38
|
def merge_query_params(params)
|
38
|
-
query_params.merge
|
39
|
-
self.query =
|
39
|
+
params = query_params.merge params
|
40
|
+
self.query = params
|
40
41
|
end
|
41
42
|
|
42
43
|
end
|
data/test/unit/http_test.rb
CHANGED
@@ -6,7 +6,7 @@ class HttpTest < TestCase
|
|
6
6
|
stub_connection_with_fixture("en.wikipedia.org")
|
7
7
|
|
8
8
|
request = Celluloid::Http::Request.new 'http://en.wikipedia.org/wiki/Http'
|
9
|
-
response = Celluloid::Http.
|
9
|
+
response = Celluloid::Http.send_request request
|
10
10
|
|
11
11
|
assert_match /Wikipedia, the free encyclopedia/, response.body
|
12
12
|
end
|