rufus-jig 0.1.21 → 0.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.txt +9 -1
- data/README.rdoc +12 -7
- data/TODO.txt +5 -3
- data/lib/rufus/jig/adapters/em.rb +19 -5
- data/lib/rufus/jig/adapters/net.rb +15 -23
- data/lib/rufus/jig/adapters/net_persistent.rb +101 -0
- data/lib/rufus/jig/adapters/net_response.rb +42 -0
- data/lib/rufus/jig/adapters/patron.rb +14 -9
- data/lib/rufus/jig/couch.rb +31 -2
- data/lib/rufus/jig/http.rb +59 -74
- data/lib/rufus/jig/version.rb +1 -1
- data/rufus-jig.gemspec +10 -3
- data/test/base.rb +10 -3
- data/test/bm/bm0.rb +49 -0
- data/test/bm/bm1.rb +43 -0
- data/test/couch_base.rb +16 -5
- data/test/couch_url.txt +1 -0
- data/test/ct_0_couch.rb +5 -5
- data/test/ct_1_couchdb.rb +6 -6
- data/test/ct_2_couchdb_options.rb +2 -6
- data/test/ct_3_couchdb_views.rb +2 -2
- data/test/ct_4_attachments.rb +2 -2
- data/test/ct_5_couchdb_continuous.rb +5 -3
- data/test/cut_0_auth_couch.rb +62 -0
- data/test/server.rb +51 -0
- data/test/test.rb +1 -1
- data/test/ut_0_http_get.rb +2 -2
- data/test/ut_6_args.rb +68 -59
- data/test/ut_7_parse_uri.rb +29 -2
- data/test/ut_8_auth.rb +37 -0
- metadata +10 -3
data/test/ut_8_auth.rb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# testing rufus-jig
|
4
|
+
#
|
5
|
+
# Fri Sep 24 17:11:26 JST 2010
|
6
|
+
#
|
7
|
+
|
8
|
+
require File.join(File.dirname(__FILE__), 'base')
|
9
|
+
|
10
|
+
|
11
|
+
class UtAuthTest < Test::Unit::TestCase
|
12
|
+
|
13
|
+
def setup
|
14
|
+
@h = Rufus::Jig::Http.new(
|
15
|
+
'127.0.0.1', 4567, :basic_auth => %w[ admin nimda ])
|
16
|
+
end
|
17
|
+
def teardown
|
18
|
+
@h.close
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_denied
|
22
|
+
|
23
|
+
h = Rufus::Jig::Http.new('127.0.0.1', 4567)
|
24
|
+
|
25
|
+
assert_raise Rufus::Jig::HttpError do
|
26
|
+
h.get('/protected')
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_authorized
|
31
|
+
|
32
|
+
assert_equal(
|
33
|
+
{ 'info' => 'secretive' },
|
34
|
+
@h.get('/protected'))
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
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
|
+
- 22
|
9
|
+
version: 0.1.22
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- John Mettraux
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-09-
|
18
|
+
date: 2010-09-30 00:00:00 +09:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -125,6 +125,8 @@ files:
|
|
125
125
|
- lib/rufus/jig.rb
|
126
126
|
- lib/rufus/jig/adapters/em.rb
|
127
127
|
- lib/rufus/jig/adapters/net.rb
|
128
|
+
- lib/rufus/jig/adapters/net_persistent.rb
|
129
|
+
- lib/rufus/jig/adapters/net_response.rb
|
128
130
|
- lib/rufus/jig/adapters/patron.rb
|
129
131
|
- lib/rufus/jig/couch.rb
|
130
132
|
- lib/rufus/jig/http.rb
|
@@ -132,14 +134,18 @@ files:
|
|
132
134
|
- lib/rufus/jig/version.rb
|
133
135
|
- rufus-jig.gemspec
|
134
136
|
- test/base.rb
|
137
|
+
- test/bm/bm0.rb
|
138
|
+
- test/bm/bm1.rb
|
135
139
|
- test/conc/put_vs_delete.rb
|
136
140
|
- test/couch_base.rb
|
141
|
+
- test/couch_url.txt
|
137
142
|
- test/ct_0_couch.rb
|
138
143
|
- test/ct_1_couchdb.rb
|
139
144
|
- test/ct_2_couchdb_options.rb
|
140
145
|
- test/ct_3_couchdb_views.rb
|
141
146
|
- test/ct_4_attachments.rb
|
142
147
|
- test/ct_5_couchdb_continuous.rb
|
148
|
+
- test/cut_0_auth_couch.rb
|
143
149
|
- test/server.rb
|
144
150
|
- test/test.rb
|
145
151
|
- test/to.sh
|
@@ -153,6 +159,7 @@ files:
|
|
153
159
|
- test/ut_5_http_misc.rb
|
154
160
|
- test/ut_6_args.rb
|
155
161
|
- test/ut_7_parse_uri.rb
|
162
|
+
- test/ut_8_auth.rb
|
156
163
|
has_rdoc: true
|
157
164
|
homepage: http://github.com/jmettraux/rufus-jig/
|
158
165
|
licenses: []
|