forked from excon/excon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrequest_method_tests.rb
47 lines (33 loc) · 992 Bytes
/
request_method_tests.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Shindo.tests('Excon request methods') do
with_rackup('request_methods.ru') do
tests 'one-offs' do
tests('Excon.get').returns('GET') do
Excon.get('http://localhost:9292').body
end
tests('Excon.post').returns('POST') do
Excon.post('http://localhost:9292').body
end
tests('Excon.delete').returns('DELETE') do
Excon.delete('http://localhost:9292').body
end
end
tests 'with a connection object' do
connection = nil
tests('connection.get').returns('GET') do
connection = Excon.new('http://localhost:9292')
connection.get.body
end
tests('connection.post').returns('POST') do
connection.post.body
end
tests('connection.delete').returns('DELETE') do
connection.delete.body
end
tests('not modifies path argument').returns('path') do
path = 'path'
connection.get(:path => path)
path
end
end
end
end